VideoHelp Forum
+ Reply to Thread
Results 1 to 9 of 9
  1. Member
    Join Date : Oct 2008
    Location : United States
    Search Comp PM
    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 and this is the version of xvid I installed (ffmpeg complained about not having a xvid dll)
    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:
    Included libraries:
    FAAC 1.26
    FAAD2 2.6.1
    gsm 1.0.12
    LAME 3.98.2
    liba52 0.7.4
    liboil 0.3.15
    libtheora 1.0beta3
    Ogg 1.1.3
    SDL 1.2.13
    Shroedinger 1.0.5
    x264 r999
    Xvid 1.2.0-dev (CVS HEAD 2007-07-26)
    Vorbis 1.2.0
    Quote Quote  
  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date : Aug 2000
    Location : Sweden
    Search Comp PM
    Maybe try avidemux and use copy for video and audio and save as a mp4.

    If that wont work use avidemux to separate the video and audio and multiplex using YAMB, MP4muxer, etc.
    Quote Quote  
  3. Member
    Join Date : Oct 2008
    Location : United States
    Search Comp PM
    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.

    Any advice?

    Quote Quote  
  4. Member
    Join Date : Oct 2008
    Location : United States
    Search Comp PM
    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):

    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:
    23.976 FPS
    29.970 (it says 30FPS on the file when ripping)

    Good Luck!!
    Quote Quote  
  5. Member
    Join Date : Oct 2008
    Location : United States
    Search Comp PM
    What is the exact command line you have used to remux using MP4box? Here is what I have used but it seems to be ignoring the FPS line.

    MP4Box -add output_track1.h264 -fps 23.976 -add output_track2.aac New.mp4

    Quote Quote  
  6. Member
    Join Date : Oct 2008
    Location : United States
    Search Comp PM
    Here is exactly what I am using:
    mp4box -add hulu_track1.h264:fps=23.976 -add hulu_track2.aac final.mp4

    Good luck!
    Quote Quote  
  7. Member
    Join Date : Oct 2008
    Location : United States
    Search Comp PM
    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
    echo USAGE:
    echo %0 [inputFile.flv] [fps:29.97:23.976] [outputFile.mp4]
    Quote Quote  
  8. Member
    Join Date : Oct 2008
    Location : United States
    Search Comp PM
    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.
    Quote Quote  
  9. Member
    Join Date : Mar 2011
    Location : Paris, France
    Search PM

    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.

    Thank you.
    Quote Quote  

Similar Threads