I have some FLV files that have h.264 video and aac audio inside (Hulu 480p). What I want to do is remux that into a different container (mp4 would be nice but i'm fine with avi) without re-encoding since it is already in h.264. I downloaded ffmpeg (r15562) from http://www.razorbyte.com.au/ffmpeg/ and this is the version of xvid I installed (ffmpeg complained about not having a xvid dll) http://www.divx-digest.com/software/xvid.html
I also have ffdshow tryouts (latest) installed with it set to decode h.264
So, when I try using ffmpeg, at the command prompt (XP SP3), I am typing in (where m2.flv is the original):
ffmpeg -i m2.flv -vcodec copy -acodec copy m2.mp4
FFmpeg does convert the file but it continually repeats [mp4 @ 0xe28070]pts has no value... Looking back, it sometimes gives a line of information about bitrate, but the rest of the lines are that same message. At the end, it says frame=22200 fps=890 q=-1.0 117002kB time=984.02 bitrate=974.0kbits/s video:105574kB audio: 10567kB global headers: 0kB muxing overhead 0.741513%. When I try to play back the file, the audio only plays for a few seconds until becoming silent and the video is so choppy/stuttery that is it unwatchable.
I am open for any ideas (even using entirely different programs)
Edit: forgot to mention what libraries were built in my ffmpeg:
Xvid 1.2.0-dev (CVS HEAD 2007-07-26)
+ Reply to Thread
Results 1 to 9 of 9
When I try to open the flv inside of avidemux it says "No audio decoder found for this file. Save (A+V) will generate bad AVI. Save audio will work." It then opens it up, however, the only thing it displays in the preview window is a green frame. I first tried to make an mp4 using video copy and audio copy. It then said "Invalid audio stream detected. The audio stream may be invalid for this container. Continue anyway?". If I click on continue, it says "Failed".
I then tried to demux the flv. Inside of avidemux I went to audio, then clicked on save and saved it with an aac extension. I then disabled the audio track and exported the video as an mp4. I didn't see any other way for me to just extract the video (maybe I'm missing something). YAMB refused to mux the aac and the video I saved. I have a feeling that I didn't do this step correctly because the video was in an mp4 container.
Alright guys... I got it working!
For anybody that wants to remux Hulu 480p:
Check out this thread I found: (scroll down to the post by BlueCop): http://forum.doom9.org/showthread.php?t=141120
If you set things up the way I did the first post of this thread and follow BlueCop, it should work perfectly.
The only thing that can be different is finding the frame rate of the 480p video. Since many players can't figure out the frame rate of the 480p flv but can of a normal flv, simply rip the low quality stream and the high quality stream. Since the frame rate of the low quality stream and the high quality stream is the same, just use any other program to find the frame rate. Also, in the original file name (when replay is still ripping), it will usually tell you the frame rate.
Here are the ones that I have had to use so far:
29.970 (it says 30FPS on the file when ripping)
For anyone who cares here is a quick batch script to convert from FLV to MP4.
The format is
mp4encode.bat <inputfile> <fps> <outputfile>
@echo off if "%1"=="" goto use if "%2"=="" goto use if "%3"=="" goto use ffmpeg -i %1 -vcodec copy -acodec copy OUTPUT.mp4 mp4box -raw 1 OUTPUT.mp4 mp4box -raw 2 OUTPUT.mp4 del output.mp4 mp4box -add output_track1.h264:fps=%2 -add output_track2.aac %3 del output_track1.h264 del output_track2.aac goto end :use echo. echo USAGE: echo %0 [inputFile.flv] [fps:29.97:23.976] [outputFile.mp4] echo. :end
Thanks for the batch file Rick!
I had my own set of batch files to do the same thing, but yours is much more elegant and will save me some time.
This thread is several years old but I need to do the same thing: Demux H264 video and AAC audio from an FLV file, edited the crappy AAC audio, and recombine the two files into an FLV file.
YAMB and MP4muxer haven't been updated in years, and I have shallow knowledge of working with multimedia files.
What would be the easiest way to demux and remux the two files?
FWIW, I used the latest ffmpeg to demux the video stream, but VLC says it's 2h long while the original video is only 10mn, and the demuxed video doesn't play in VLC.