Method and system for media file compression
First Claim
1. A method for media file compression, comprising:
- extracting encoding parameters from an input media file, separating and decoding audio and video streams from the input media file, and extracting an original audio stream and an original video stream;
computing transcoding parameters required for a compression according to the encoding parameters;
encoding the original audio stream to output a new compressed audio stream, and encoding the original video stream to output a new compressed video stream, according to the transcoding parameters; and
synthesizing the new compressed audio stream and the new compressed video stream to create a new media file;
wherein the encoding parameter comprises a video encoding parameter and an audio encoding parameter, wherein the video encoding parameter comprises original video encoder type, original video encoding bit rate, original video encoding frame rate, and original video resolution; and
the audio encoding parameter comprises original audio encoder type, original audio encoding bit rate, original audio channel number, and original audio sample rate;
the transcoding parameter comprises a video transcoding parameter and an audio transcoding parameter, wherein the video transcoding parameter comprises target video encoder type, target video encoding bit rate, target video encoding frame rate, and target video resolution; and
the audio transcoding parameter comprises target audio encoder type, target audio encoding bit rate, target audio channel number, and target audio sample rate;
wherein the method further comprises computing the target video encoder type required for the compression;
computing the target video encoder type required for the compression is;
when the original video encoder type is RM, VC1 or H.264, determining the target video encoder type to be H.264, otherwise determining the target video encoder type to be Moving Picture Experts Group 4 (MPEG4);
wherein the method further comprises computing the target video encoding bit rate required for the compression;
computing the target video encoding bit rate required for the compression is;
computing a ratio K_fps between the target video encoding frame rate and the original video encoding frame rate, computing a ratio K_pix between the target video resolution and the original video resolution, and obtaining an alternative target video encoding bit rate in an equation of K_fps·
K_pix·
K_br·
original video encoding bit rate, wherein K_br represents a predetermined target bit rate decreasing coefficient;
selecting a most approximate reference resolution from a predetermined reference correspondence table according to the target video resolution, comparing a reference bit rate corresponding to the selected reference resolution with the alternative target video encoding bit rate, and selecting the smaller bit rate as the target video encoding bit rate required for the compression.
0 Assignments
0 Petitions
Accused Products
Abstract
The present invention discloses a method for media file compression, which includes: extracting the encoding parameters from an input media file, separating and decoding the audio and video stream from the input media file, and extracting an original audio stream and an original video stream; computing the transcoding parameters required for compression according to the encoding parameters; encoding the original audio stream to output a new compressed audio stream, and encoding the original video stream to output a new compressed video stream according to the transcoding parameters; synthesizing the new compressed audio stream and the new compressed video stream to create a new media file. The present invention also provides a system for media file compression. By means of the method and system of the present invention, users can realize simple and rapid compression for media files of various formats without understanding media expertise, and the storage space can be saved, so that it is convenient to carry, transfer and share the media files.
-
Citations
2 Claims
-
1. A method for media file compression, comprising:
-
extracting encoding parameters from an input media file, separating and decoding audio and video streams from the input media file, and extracting an original audio stream and an original video stream; computing transcoding parameters required for a compression according to the encoding parameters; encoding the original audio stream to output a new compressed audio stream, and encoding the original video stream to output a new compressed video stream, according to the transcoding parameters; and synthesizing the new compressed audio stream and the new compressed video stream to create a new media file; wherein the encoding parameter comprises a video encoding parameter and an audio encoding parameter, wherein the video encoding parameter comprises original video encoder type, original video encoding bit rate, original video encoding frame rate, and original video resolution; and the audio encoding parameter comprises original audio encoder type, original audio encoding bit rate, original audio channel number, and original audio sample rate; the transcoding parameter comprises a video transcoding parameter and an audio transcoding parameter, wherein the video transcoding parameter comprises target video encoder type, target video encoding bit rate, target video encoding frame rate, and target video resolution; and the audio transcoding parameter comprises target audio encoder type, target audio encoding bit rate, target audio channel number, and target audio sample rate; wherein the method further comprises computing the target video encoder type required for the compression; computing the target video encoder type required for the compression is; when the original video encoder type is RM, VC1 or H.264, determining the target video encoder type to be H.264, otherwise determining the target video encoder type to be Moving Picture Experts Group 4 (MPEG4); wherein the method further comprises computing the target video encoding bit rate required for the compression; computing the target video encoding bit rate required for the compression is; computing a ratio K_fps between the target video encoding frame rate and the original video encoding frame rate, computing a ratio K_pix between the target video resolution and the original video resolution, and obtaining an alternative target video encoding bit rate in an equation of K_fps·
K_pix·
K_br·
original video encoding bit rate, wherein K_br represents a predetermined target bit rate decreasing coefficient;selecting a most approximate reference resolution from a predetermined reference correspondence table according to the target video resolution, comparing a reference bit rate corresponding to the selected reference resolution with the alternative target video encoding bit rate, and selecting the smaller bit rate as the target video encoding bit rate required for the compression. - View Dependent Claims (2)
-
Specification