View Full Version : FLV re-encapsulated (no re-encoding) as MP4, preferred method?
florinandrei
16th March 2010, 01:27
This has to be a typical problem: there's a YouTube FLV with an h264 video track and an mp4a (AAC I guess) audio. It should be trivial to re-encapsulate it as MP4, since no re-encoding is necessary. However, I'm having problems finding a tool that can do it in one step.
Yamb was the first option, but apparently it can't read FLV.
Avidemux can't open the FLV either, it just shows a green rectangle instead of video.
MeGUI will force re-encoding.
Any other ideas?
Dark Shikari
16th March 2010, 01:50
ffmpeg -i input -acodec copy -vcodec copy output.mp4
florinandrei
16th March 2010, 02:25
ffmpeg -i input -acodec copy -vcodec copy output.mp4
Ah, yes, good idea. I'll have to try the Windows ffmpeg since my main multimedia system runs Vista, but that's okay. Meanwhile I've got plenty of Linux systems hanging around, so that's not a problem.
How good is ffmpeg at maintaining A/V sync?
How "standards compliant" or "clean" is the MP4 encapsulation when it's generated by ffmpeg?
Dark Shikari
16th March 2010, 02:38
Ah, yes, good idea. I'll have to try the Windows ffmpeg since my main multimedia system runs Vista, but that's okay. Meanwhile I've got plenty of Linux systems hanging around, so that's not a problem.What's special about "the windows ffmpeg"? You can get recent builds here (http://ffmpeg.arrozcru.org/autobuilds).How good is ffmpeg at maintaining A/V sync?Very; I know of no possible situation in which FLV->MP4 could cause desync.How "standards compliant" or "clean" is the MP4 encapsulation when it's generated by ffmpeg?Better than most.
florinandrei
16th March 2010, 02:48
I did a quick conversion on Linux, haven't tested the MP4 yet on the PS3 via the UPnP server (it being the purpose of the whole exercise) but in VLC the resulting MP4 file is fine.
Question: the ffmpeg warning below referring to the frame rate mismatch, does it indicate a mismatch in the source file? In other words, is it the FLV's fault?
The FLV file was downloaded from Youtube with youtube-dl -tb http://www.youtube.com/watch?v=-cM9S2AzU28
Here's the ffmpeg output:
$ ffmpeg -i BMW_S1000_RR_Dinner_for_RR--cM9S2AzU28.flv -acodec copy -vcodec copy BMW_S1000_RR_Dinner_for_RR--cM9S2AzU28.mp4
FFmpeg version SVN-r19352-4:0.5+svn20090706-2ubuntu2, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --extra-version=4:0.5+svn20090706-2ubuntu2 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --extra-cflags=-I/build/buildd/ffmpeg-0.5+svn20090706/debian/include --enable-shared --disable-static
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 0 / 52.20. 0
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libavfilter 0. 4. 0 / 0. 4. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Oct 13 2009 22:15:16, gcc: 4.4.1
Seems stream 0 codec frame rate differs from container frame rate: 50.00 (50/1) -> 25.00 (25/1)
Input #0, flv, from 'BMW_S1000_RR_Dinner_for_RR--cM9S2AzU28.flv':
Duration: 00:01:07.00, start: 0.000000, bitrate: 1127 kb/s
Stream #0.0: Video: h264, yuv420p, 854x480 [PAR 1:1 DAR 427:240], 1127 kb/s, 25 tbr, 1k tbn, 50 tbc
Stream #0.1: Audio: aac, 44100 Hz, stereo, s16
Output #0, mp4, to 'BMW_S1000_RR_Dinner_for_RR--cM9S2AzU28.mp4':
Stream #0.0: Video: 0x0000, yuv420p, 854x480 [PAR 1:1 DAR 427:240], q=2-31, 1127 kb/s, 90k tbn, 25 tbc
Stream #0.1: Audio: 0x0000, 44100 Hz, stereo, s16
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
frame= 1676 fps= 0 q=-1.0 Lsize= 9897kB time=67.04 bitrate=1209.4kbits/s
video:8999kB audio:843kB global headers:0kB muxing overhead 0.555729%
Dark Shikari
16th March 2010, 03:55
The warning is a bug in ffmpeg. Ignore it.
wbardo
16th March 2010, 13:08
This has to be a typical problem: there's a YouTube FLV with an h264 video track and an mp4a (AAC I guess) audio. It should be trivial to re-encapsulate it as MP4, since no re-encoding is necessary.
Any other ideas?
[*avih: advertisement*]
kypec
17th March 2010, 09:15
[*avih: advertisement*]
Thanks for your *helpful offer* but we prefer to use free solutions around here.:readrule:
Gavino
17th March 2010, 13:24
This has to be a typical problem: there's a YouTube FLV with an h264 video track and an mp4a (AAC I guess) audio. It should be trivial to re-encapsulate it as MP4, since no re-encoding is necessary. However, I'm having problems finding a tool that can do it in one step.
Yamb was the first option, but apparently it can't read FLV.
Avidemux can't open the FLV either, it just shows a green rectangle instead of video.
You can use FLVExtract to demux before using Yamb. I know it's an extra step, but it's very fast.
The latest version of Avidemux should be able to open FLV's containing h264/aac (earlier versions couldn't).
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.