CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a U.S. National Stage of International Patent Application No. PCT/CN2017/076192 filed on Mar. 9, 2017, which claims priority to Chinese Patent Application No. 201611053695.5 filed on Nov. 25, 2016. Both of the aforementioned applications are hereby incorporated bt reference in their entireties.

TECHNICAL FIELD

This application relates to the field of information technologies, and in particular, to a multimedia file sharing method and a terminal device.

BACKGROUND

With development of terminal devices such as smartphones, tablet computers, smart cameras, and various wearable devices, many terminal devices have a function of photographing or processing multimedia files such as pictures and videos. It is becoming increasingly convenient for users to obtain various multimedia files, and the users get more pleasure in life by sharing the multimedia files with other contacts. For example, when a user participates in an activity such as a party with a friend and takes a picture for the friend by using a mobile phone, the user usually needs to share, with the corresponding friend, the picture taken for the friend.

Currently, a user shares a multimedia file with a contact usually by using the following methods:

1. The user selects a to-be-shared multimedia file from a location of storing multimedia files, selects a sending entry (a communications application) from a menu that appears, and then selects, from the communications application, a contact with whom the user wants to share, so as to send the multimedia file to the contact.

2. After obtaining a to-be-shared multimedia file through photographing or obtaining a to-be-shared multimedia file by performing editing processing on a picture or a video, the user starts a communications application, selects a contact with whom the user wants to share, opens a communications interface, selects the multimedia file by using the communications interface, and taps to send, to send the multimedia file to the contact.

3. After obtaining a to-be-shared multimedia file through photographing or obtaining a to-be-shared multimedia file by performing editing processing on a picture or a video, the user starts a communications application, establishes, through a series of operations, a group with a contact with whom the user wants to share, then opens a communications interface of the group, selects a picture taken by using the communications interface, and taps a send button, to send the multimedia file to the contact.

4. To resolve a problem of complex operations in the foregoing sharing methods, a terminal device may perform facial recognition on a face picture included in a to-be-shared multimedia file (a picture is only used as an example for description), then determine a matching degree between the face picture and a pre-stored profile image of a contact, and send a to-be-shared picture to the contact when the matching degree reaches a specified threshold. However, in this sharing method, a face picture of the contact needs to be set as the profile image of the contact. Otherwise, the terminal device cannot accurately determine a receiver of the to-be-shared picture, and further, cannot implement quick sharing.

It may be learned from descriptions of the foregoing methods that in the foregoing conventional multimedia file sharing methods, the operations are complex, or the receiver of the to-be-shared multimedia file cannot be accurately determined due to relatively poor applicability. Consequently, quick sharing cannot be implemented, and user experience is reduced.

SUMMARY

Embodiments of this application provide a multimedia file sharing method and a terminal device, to resolve problems that quick sharing cannot be implemented and user experience is reduced in a conventional multimedia file sharing method in which operations are complex, or a receiver of a to-be-shared multimedia file cannot be accurately determined due to relatively poor applicability.

According to a first aspect, an embodiment of this application provides a multimedia file sharing method. The method includes: First, a terminal device performs facial recognition on a displayed picture, to obtain a face picture in the picture. Then, the terminal device matches the face picture with a face template included in a specified face information template, and when determining that the face picture successfully matches a first face template included in the specified first face information template, determines first contact information corresponding to the first face template included in the first face information template. The first contact information indicates a method for contacting a first contact to which the first face template belongs. Finally, the terminal device sends a multimedia file to the first contact based on the first contact information. The multimedia file is the picture, a picture set or a video file including the picture, or a picture or a video file generated based on the picture.

According to the foregoing method, the terminal device can quickly and accurately determine an identity of a face in the face picture in the picture through facial recognition and matching between the face picture and the face template in the face information template, that is, determine a receiver when sharing the multimedia file. Therefore, contact information of the receiver can be determined, and the multimedia file can be quickly shared based on the contact information. Obviously, in the method, a user does not need to perform complex operations, and the terminal device can quickly and accurately determine the receiver when sharing the multimedia file, so that the terminal device can implement quick sharing of the multimedia file, thereby improving user experience.

In a possible design, in a scenario in which the terminal device enables a photographing function, the picture is a picture of a to-be-photographed scene that is displayed in a viewfinder frame in a process of photographing the to-be-photographed scene by the terminal device. In this case, the terminal device receives a photographing completion instruction, generates the multimedia file for the to-be-photographed scene based on the picture, and sends the multimedia file to the first contact based on the first contact information.

According to the method, after enabling the photographing function, the terminal device performs facial recognition on the picture in the viewfinder frame, and matches the face picture with the face template in the face information template, to quickly and accurately determine the receiver of the multimedia file generated after photographing is completed. Therefore, after completing the photographing, the terminal device quickly sends the generated multimedia file to the receiver, thereby implementing quick sharing of the multimedia file, and improving user experience.

In a possible design, the picture is a picture displayed by the terminal device in a multimedia file editing and production process. In this case, the terminal device sends the multimedia file to the first contact based on the first contact information after generating the multimedia file based on the picture in the multimedia file editing and production process.

According to the method, the terminal device performs facial recognition on the picture in the multimedia file editing and production process, and matches the face picture with the face template in the face information template, to quickly and accurately determine the receiver of the multimedia file generated through editing and production. Therefore, after obtaining the multimedia file through editing and production, the terminal device quickly sends the generated multimedia file to the receiver, thereby implementing quick sharing of the multimedia file, and improving user experience.

In a possible design, the first contact information includes identification information of the first contact. For example, the identification information of the first contact is a mobile phone number, an email address, or the like of the first contact. In this case, the terminal device sends the multimedia file to the first contact based on the first contact information by using the following method:

The terminal device determines a communications application based on the identification information of the first contact; and sends the multimedia file to the first contact based on the identification information of the first contact by using the communications application.

According to the foregoing method, the terminal device may determine, based on the identification information of the first contact, a communications application used when sharing the multimedia file, to accurately send the multimedia file to the first contact.

In a possible design, the first contact information includes identification information of a first communications application and identification information of the first contact. In this case, the terminal device sends the multimedia file to the first contact based on the first contact information by using the following method: The terminal device sends the multimedia file to the first contact based on the identification information of the first contact by using a communications application corresponding to the identification information of the first communications application.

According to the foregoing method, the terminal device can accurately send the multimedia file to the first contact.

In a possible design, after performing facial recognition on the picture, the terminal device obtains at least one other face picture in the picture. Then, after determining that one of the at least one other face picture successfully matches a second face template in a specified second face information template, the terminal device determines second contact information corresponding to the second face template included in the second face information template. The second contact information identifies a method for contacting a second contact to which the second face template belongs. The terminal device sends the multimedia file to the first contact and the second contact based on the first contact information and the second contact information.

According to the foregoing method, after determining that a plurality of face pictures included in the picture successfully match face templates in multi-person face templates, the terminal device can quickly and accurately send the multimedia file to a plurality of contacts, thereby implementing quick sharing of the multimedia file, and improving user experience.

In a possible design, after performing facial recognition on the picture, the terminal device obtains at least one other face picture in the picture. Then, after determining that one of the at least one other face picture successfully matches a second face template in a specified second face information template, the terminal device determines second contact information corresponding to the second face template included in the second face information template. The second contact information identifies a method for contacting a second contact to which the second face template belongs. The terminal device starts or establishes, based on the first contact information and the second contact information, a communication group including the first contact and the second contact, and sends the multimedia file in the communication group.

According to the foregoing method, after determining that a plurality of face pictures included in the picture successfully match face templates in multi-person face templates, the terminal device may send the multimedia file to a plurality of contacts by establishing a communication group, so that the terminal device does not need to send the multimedia file to each of the plurality of contacts, thereby reducing workload of the terminal device, and reducing power consumption of the terminal device.

In a possible design, the first contact information includes identification information of a first communications application and identification information of the first contact, and the second contact information includes identification information of a second communications application and identification information of the second contact. In this case, the terminal device starts or establishes the communication group by using the following method:

After determining that the identification information of the first communications application in the first contact information is the same as the identification information of the second communications application in the second contact information, the terminal device starts or establishes the communication group based on the identification information of the first contact and the identification information of the second contact by using a communications application corresponding to the identification information of the first communications application.

According to the method, the terminal device can start or establish a communication group for contacts using a same communications application.

According to a second aspect, an embodiment of this application further provides a face information template establishment method. The method includes: A terminal device determines a face template of a contact in a communications application based on obtained at least one template source file of the contact. The template source is a picture or a video file. Then, the terminal device generates contact information of the contact, and establishes a face information template based on the face template and the contact information. The face information template indicates a correspondence between the face template and the contact information, and the contact information indicates a method for contacting the contact to which the face template belongs.

According to the foregoing method, the terminal device can quickly and accurately establish the face information template for the contact. In this way, when sharing a multimedia file, the terminal device can quickly send, to the contact by using the face information template, the multimedia file needing to be shared.

In a possible design, the terminal device obtains the at least one template source file by using the following method: The terminal device obtains a communication record between a user of the terminal device and the contact, and selects the at least one template source file from the communication record. In this case, the terminal device determines the face template of the contact in the at least one template source file by using the following method: First, the terminal device obtains, from the communication record, communication information associated with each template source file. Then, the terminal device performs semantic analysis on the communication information associated with each template source file, and determines whether a face picture of the contact exists in each template source file. Finally, the terminal device determines, in the at least one template source file, a to-be-selected template source file in which a face picture of the contact exists, and determines the face template based on the face picture of the contact that exists in the to-be-selected template source file. In the foregoing design, communication content associated with any template source file satisfies any one of the following conditions: a difference between a location of the communication information and a location of the template source file falls within a specified location range, a difference between a sending time of the communication information and a sending time of the template source file falls within a specified time range, or the communication information is communication content that falls within a specified word count range before and after the template source file is sent.

The foregoing method is applicable to a scenario in which a picture or a video file including the face picture of the contact is sent between the user of the terminal device and the contact. In addition, when the user and the contact describe, in the communication information before and after the picture or the video file is sent, a face of the contact in the picture or the video file, a template source file in which a face picture of the contact exists can be quickly and accurately determined in a plurality of template source files by using the method, so as to accurately determine the face template of the contact. Obviously, according to the method, efficiency and flexibility of determining the face template by the terminal device are improved.

In a possible design, the terminal device obtains the at least one template source file by using the following method:

The terminal device obtains a communication record between a user of the terminal device and the contact, and selects the at least one template source file from the communication record. In this case, the terminal device may determine the face template of the contact in the at least one template source file by using the following method: The terminal device first determines all face pictures appearing in the at least one template source file, and then groups all the determined face pictures by using a facial recognition technology, to obtain at least one face picture group. All face pictures belonging to a same face picture group are recognized as being from a same person. The terminal device selects, from the at least one face picture group, a target face picture group including a largest quantity of face pictures, and determines the face template based on the face pictures included in the target face picture group.

According to the foregoing method, the terminal device may perform facial recognition on a template source file sent by the contact before, to obtain a largest quantity of faces, and use the face appearing for the largest quantity of times as the face template of the contact, so as to determine the face template based on the face picture including the face. The method is applicable to a scenario in which pictures or video files are frequently sent between the user of the terminal device and the contact. In addition, during actual application, a phenomenon in which the contact sends, by using the communications application, a picture or a video including a face of the contact is relatively common, and the terminal device does not need to obtain communication information of context of the picture or the video file in the method or perform voice analysis on the communication information. Therefore, according to the method, the face template can be quickly determined, and a probability that the determined face template belongs to the contact is relatively high. Therefore, according to the method, efficiency and flexibility of determining the face template by the terminal device100are improved.

In a possible design, the terminal device may further obtain the at least one template source file in the following two manners:

First manner: The terminal device obtains the at least one template source file stored for a video call between a user of the terminal device and the contact.

Second manner: The terminal device obtains, in a video calling process between the user and the contact, the at least one template source file in a video call displayed by the terminal device.

When the terminal device obtains the at least one template source file in the foregoing manners, the terminal device may determine the face template of the contact in the at least one template source file by using the following method:

The terminal device first determines all face pictures appearing in the at least one template source file; and then groups all the determined face pictures by using a facial recognition technology, to obtain at least one face picture group. All face pictures belonging to a same face picture group are recognized as being from a same person. Then, the terminal device determines a quantity of the at least one face picture group.

When the quantity of the at least one face picture group is 1, the terminal device determines the face template based on the face pictures included in the obtained face picture group.

When the quantity of the at least one face picture group is greater than or equal to 2, the terminal device selects a target face picture group from the at least one face picture group, where the target face picture group includes a largest quantity of face pictures, or a face picture included in the target face picture group does not match any other stored face template or a profile image of any other contact; and determines the face template based on the face picture included in the target face picture group.

According to the foregoing method, the method is applicable to a scenario in which the terminal device stores a video call record between the user and the contact or in which the user and the contact are performing a video call. In a video file of the video call or a displayed picture, the contact is usually displayed. Therefore, when determining that only one face appears in the obtained template source file, the terminal device can quickly determine the face template based on a face picture including the face, thereby improving flexibility and efficiency of determining the face template by the terminal device. When determining that a plurality of faces appear in the obtained template source file, the terminal device may select, by using a plurality of selection principles, a face picture including a face of the contact, and accurately determine the face template based on the face picture including the face, thereby improving flexibility of determining the face template by the terminal device.

In a possible design, the terminal device may further obtain the at least one template source file by using the following method: The terminal device obtains at least one template source file published by the contact in a social network of the communications application. In this case, the terminal device determines the face template of the contact in the at least one template source file by using the following method: The terminal device obtains, from the social network, published information associated with each template source file, then performs semantic analysis on the published information associated with each template source file, determines whether a face picture of the contact exists in each template source file, determines, in the at least one template source file, a to-be-selected template source file in which a face picture of the contact exists. Finally, the terminal device determines the face template based on the face picture of the contact that exists in the to-be-selected template source file. Published information associated with any template source file includes one or a combination of the following: information published by the contact when publishing the template source file, and comment information published by another contact for the template source file.

The foregoing method is applicable to a scenario in which the contact has published a picture or a video including the face picture of the contact in the social network, and the contact or another contact publishes a description about a face of the contact for the picture or the video. According to the foregoing method, the terminal device may perform semantic analysis on context of a template source file published by the contact in the social network before, so as to quickly and accurately recognize, from the template source file sent before, the template source file in which the face picture of the contact exists, and further determine the face template based on the face picture in the template source file. Obviously, according to the method, efficiency and flexibility of determining the face template by the terminal device are improved.

In a possible design, the terminal device obtains a profile image of the contact, to obtain the at least one template source file. In this case, the terminal device determines the face template of the contact in the at least one template source file in the following manner: After performing facial recognition on the profile image, to determine that the profile image is a face picture, the terminal device determines the face template based on the profile image.

The method is applicable to a scenario in which the user sets the profile image for the contact or the contact sets the profile image. In the method, the terminal device can determine the face template by quickly obtaining the profile image of the contact and quickly determining, through facial recognition, whether the profile image is a face picture. Obviously, according to the method, the face template can be quickly and accurately determined, thereby improving efficiency and flexibility of determining the face template by the terminal device.

In a possible design, the terminal device establishes the face information template based on the face template and the contact information by using the following steps:

The terminal device displays a confirmation request, and establishes the face information template based on the face template and the contact information after receiving a confirmation response of the user. The confirmation request is used to inform the user of the terminal device that the face template of the contact has been determined and request the user to confirm whether the face template is correct. The confirmation response is used to notify the terminal device that the user has confirmed that the face template is correct.

According to the foregoing method, the terminal device establishes the face information template after obtaining a confirmation of the user, so as to ensure accuracy of the face information template.

In a possible design, the contact information includes identification information of the communications application and identification information of the contact, or the contact information includes identification information of the contact.

In a possible design, the terminal device may perform the method according to the first aspect or any design for each contact in each communications application installed in the terminal device, so as to establish a plurality of face information templates. In this way, when sharing a template source file, the terminal device can quickly determine a receiver of the to-be-shared template source file by using the plurality of established face information templates, thereby implementing quick sharing of the template source file.

According to a third aspect, an embodiment of this application further provides a terminal device. The terminal device has a function of implementing operations of the terminal device in the foregoing method example in the first aspect. The function may be implemented by hardware, or may be implemented by hardware executing corresponding software. The hardware or the software includes one or more modules corresponding to the foregoing function.

In a possible design, a structure of the terminal device includes a detection unit, a processing unit, and a sending unit. These units can perform corresponding functions in the foregoing method example. For details, refer to the detailed descriptions in the method example, and details are not described herein again.

According to a fourth aspect, an embodiment of this application further provides a terminal device. The terminal device has a function of implementing operations of the terminal device in the foregoing method example in the first aspect. The function may be implemented by hardware. A structure of the terminal device includes a communications module, a processor, a bus, a display panel, and a memory. The processor, the display panel, and the memory are connected by using the bus. The display panel is configured to display a picture. The processor invokes an instruction stored in the memory, to perform the foregoing method. The communications template is configured to send a multimedia file.

In a possible design, the communications module may be an RF circuit, a WiFi module, a communications interface, a Bluetooth module, or the like.

In a possible design, the terminal device includes a camera, configured to photograph a to-be-photographed scene, to collect a picture for the to-be-photographed scene.

The display panel is configured to display a viewfinder frame. The viewfinder frame displays the picture for the to-be-photographed scene.

The terminal device further includes an input device such as a touch panel, configured to input a photographing completion instruction.

The processor is configured to: after receiving the photographing completion instruction, generate the multimedia file for the to-be-photographed scene based on the picture.

According to a fifth aspect, an embodiment of this application further provides a terminal device. The terminal device has a function of implementing operations of the terminal device in the foregoing method example in the second aspect. The function may be implemented by hardware, or may be implemented by hardware executing corresponding software. The hardware or the software includes one or more modules corresponding to the foregoing function.

In a possible design, a structure of the terminal device includes a determining unit and a processing unit. These units can perform corresponding functions in the foregoing method example. For details, refer to the detailed descriptions in the method example, and details are not described herein again.

According to a sixth aspect, an embodiment of this application further provides a terminal device. The terminal device has a function of implementing operations of the terminal device in the foregoing method example in the second aspect. The function may be implemented by hardware. A structure of the terminal device includes a processor, a bus, and a memory. The processor and the memory are connected by using the bus. The processor invokes an instruction stored in the memory, to perform the foregoing method.

In a possible design, the memory is configured to store a communication record between a user of the terminal device and a contact. The processor obtains the communication record from the memory, and selects at least one template source file from the communication record. The template source file is a picture or a video file.

In a possible design, the memory is configured to store a video file or a picture (the at least one template source file of the contact) in a video call between a user of the terminal device and the contact. The processor obtains the at least one template source file from the memory.

In a possible design, the terminal device further includes a display panel. In a video calling process between a user of the terminal device and the contact, the display panel is configured to display a video file (the at least one template source file of the contact) in a video call. The processor obtains the at least one template source file displayed in the display panel.

In a possible design, the terminal device further includes a communications module. The processor obtains at least one template source file published by the contact in a social network of the communications application or a profile image of the contact.

In a possible design, after determining a face template of the contact, the processor displays a confirmation request by using the display panel, to inform the user of the terminal device that the face template has been determined and request the user to confirm whether the face template is correct. The terminal device further includes an input unit such as a touch panel. The user enters, by using the input unit, a confirmation response used to notify the terminal device that the user has confirmed that the face template is correct.

According to a seventh aspect, an embodiment of this application further provides a computer storage medium. The storage medium stores a software program. When read and executed by one or more processors, the software program may implement the method according to the first aspect or any design of the first aspect.

According to an eighth aspect, an embodiment of this application further provides a computer storage medium. The storage medium stores a software program. When read and executed by one or more processors, the software program may implement the method according to the second aspect or any design of the second aspect.

In the embodiments of this application, the terminal device obtains the face picture in the currently displayed picture through facial recognition, and when determining that the first face template included in the first face information template successfully matches the face picture, sends, based on the first contact information in the first face information template, the multimedia file to the first contact to which the first face template belongs. The multimedia file is the picture, a picture set or a video file including the picture, or a picture or a video file generated based on the picture. According to the foregoing method, the terminal device can quickly and accurately determine an identity of a face in the face picture in the picture through facial recognition and matching between the face picture and the face template in the face information template, that is, determine a receiver when sharing the multimedia file. Therefore, contact information of the receiver can be determined, and the multimedia file can be quickly shared based on the contact information. Obviously, in the method, a user does not need to perform complex operations, and the terminal device can quickly and accurately determine the receiver when sharing the multimedia file, so that the terminal device can implement quick sharing of the multimedia file, thereby improving user experience.

