Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
21st January 2016, 23:32 | #1 | Link |
Registered User
Join Date: Jan 2004
Posts: 7
|
How to change the framerate of an MP4 file without re-encoding video?
Hi all,
I have a poorly encoded video of a webcast (I presume it came from a WebEx screencast) and the main issue is that the framerate of the mp4 file is double than it should be. If I play it with VLC and slow down the playback speed to 0.5x, everything's normal and I can understand the audio. If I play it at 1x, I can't understand anything and everything's too fast. Mediainfo says this about the file: Code:
General Complete name : source.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom File size : 181 MiB Duration : 33mn 53s Overall bit rate mode : Constant Overall bit rate : 748 Kbps Writing application : Lavf56.19.100 Video ID : 1 Format : MPEG-4 Visual Format profile : Simple@L1 Format settings, BVOP : No Format settings, QPel : No Format settings, GMC : No warppoints Format settings, Matrix : Default (H.263) Codec ID : 20 Duration : 33mn 53s Bit rate mode : Constant Bit rate : 674 Kbps Width : 640 pixels Height : 480 pixels Display aspect ratio : 4:3 Frame rate mode : Variable Frame rate : 10.000 fps Minimum frame rate : 9.990 fps Maximum frame rate : 29.970 fps Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Compression mode : Lossy Bits/(Pixel*Frame) : 0.220 Stream size : 163 MiB (90%) Writing library : Lavc52.108.0 Audio ID : 2 Format : AAC Format/Info : Advanced Audio Codec Format profile : LC Codec ID : 40 Duration : 33mn 53s Duration_LastFrame : -19ms Bit rate mode : Constant Bit rate : 70.2 Kbps Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 48.0 KHz Compression mode : Lossy Stream size : 17.0 MiB (9%) Code:
$ mp4box -add source.mp4\#video -raw 1 -new video Code:
$ mp4box -add source.mp4\#audio -raw 2 -new audio I then tried combining them with: Code:
$ mp4box -add video_track1.cmp:fps=5 -add audio_track2.aac:fps=5 -new dest.mp4 Code:
General Complete name : dest.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom File size : 181 MiB Duration : 1h 7mn Overall bit rate mode : Variable Overall bit rate : 373 Kbps Encoded date : UTC 2016-01-21 22:24:30 Tagged date : UTC 2016-01-21 22:24:30 Video ID : 1 Format : MPEG-4 Visual Format profile : Simple@L1 Format settings, BVOP : No Format settings, QPel : No Format settings, GMC : No warppoints Format settings, Matrix : Default (H.263) Codec ID : 20 Duration : 1h 7mn Bit rate mode : Variable Bit rate : 337 Kbps Maximum bit rate : 929 Kbps Width : 640 pixels Height : 480 pixels Display aspect ratio : 4:3 Frame rate mode : Constant Frame rate : 5.000 fps Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Compression mode : Lossy Bits/(Pixel*Frame) : 0.220 Stream size : 163 MiB (90%) Title : cmp:fps=5@GPAC0.5.1-DEV-rev5375 Writing library : Lavc52.108.0 Encoded date : UTC 2016-01-21 22:24:30 Tagged date : UTC 2016-01-21 22:24:55 Audio ID : 2 Format : AAC Format/Info : Advanced Audio Codec Format profile : LC Codec ID : 40 Duration : 33mn 53s Bit rate mode : Variable Bit rate : 70.2 Kbps Maximum bit rate : 87.8 Kbps Channel(s) : 2 channels Channel(s)_Original : 3 channels Channel positions : Front: L C R Sampling rate : 48.0 KHz Compression mode : Lossy Stream size : 17.0 MiB (9%) Title : aac:fps=5@GPAC0.5.1-DEV-rev5375 Encoded date : UTC 2016-01-21 22:24:52 Tagged date : UTC 2016-01-21 22:24:55 How do I fix the audio track? I don't mind re-encoding it with ffmpeg if that's the only option. I don't know how to do it however. Also, can mp4box do this on its own? What am I doing wrong? |
22nd January 2016, 00:19 | #2 | Link | |
Retried Guesser
Join Date: Jun 2012
Posts: 1,373
|
FFMpeg: How to speed up / slow down a video
Quote:
Code:
DirectShowSource("input.mkv") AssumeFPS(5, sync_audio=true) |
|
22nd January 2016, 00:34 | #3 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Nice one Raff, Archiving your post.
Yesterday, encoded MP4 @ Aspect Ratio 240:1, was a bit of a struggle to re-AR @ 2.40:1 Is there a standard ffmpeg fix for that (there is a special ffmpeg version that re-does AR, somewhere on site). (I used YAMB + MeGUI, about 6 tries to get correct). EDIT: Some links on changing AR http://forum.doom9.org/showthread.php?t=152419 http://forum.videohelp.com/threads/3...out-reencoding http://forum.videohelp.com/threads/3...ut-re-encoding
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 22nd January 2016 at 00:44. Reason: Add links |
22nd January 2016, 01:11 | #4 | Link | ||
Registered User
Join Date: Jan 2004
Posts: 7
|
Quote:
Code:
ffmpeg -i source.mp4 -filter_complex "[0:a]atempo=0.5[a]" -map "[a]" outputaudio.m4a and this... which is a simplified, audio-only, option: ffmpeg -i out.m4a -filter:a "atempo=0.5" -vn outputaudio.aac Result: audio sounds horrible It has that weird metallic sounding echo all over the track. It sounds nothing like what you hear when you slow down to 0.5x with VLC. I'm still unsure how to proceed... Quote:
Several times I managed to change aspect ratio without re-encoding by doing this: Code:
ffmpeg -i in.mp4 -vcodec copy -acodec copy -aspect 16:9 output.mp4 |
||
22nd January 2016, 01:21 | #5 | Link |
Registered User
Join Date: Jan 2004
Posts: 7
|
My previous post ended up in moderation queue because I quoted StainlessS's post with lots of links
Anyway, abreviation: raffriff42: I tried this: Code:
ffmpeg -i out.m4a -filter:a "atempo=0.5" -vn outputaudio.aac same as: ffmpeg -i source.mp4 -filter_complex "[0:a]atempo=0.5[a]" -map "[a]" outputaud.m4a StainlessS: I always try changing AR like this... without re-encoding. Most of the time it works great: Code:
ffmpeg -i in.mp4 -vcodec copy -acodec copy -aspect 16:9 output.mp4 |
Tags |
ffmpeg, mp4box |
Thread Tools | Search this Thread |
Display Modes | |
|
|