VideoHelp Forum




+ Reply to Thread
Results 1 to 4 of 4
  1. Member
    Join Date
    Oct 2008
    Location
    United States
    Search Comp PM
    I have several FLVs I've downloaded, all with exactly the same properties (bitrate, codec, channels, etc.). An example of one:
    Code:
    ffmpeg -i sp-1-4-2.flv
    FFmpeg version UNKNOWN, Copyright (c) 2000-2008 Fabrice Bellard, et al.
      configuration: --enable-nonfree --enable-pthreads --enable-x11grab --enable-liba52 --enable-libfaac --enable-libfaad --enable-libx264 --enable-libxvid --enable-libmp3lame --enable-gpl --enable-postproc --enable-swscale --enable-libvorbis --enable-libtheora --enable-libdc1394 --disable-debug --enable-shared --prefix=/usr
      libavutil     49.10. 0 / 49.10. 0
      libavcodec    51.71. 0 / 51.71. 0
      libavformat   52.22. 1 / 52.22. 1
      libavdevice   52. 1. 0 / 52. 1. 0
      libswscale     0. 6. 1 /  0. 6. 1
      libpostproc   51. 2. 0 / 51. 2. 0
      built on Sep  7 2008 11:10:32, gcc: 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
    
    Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 29.97 (30000/1001)
    Input #0, flv, from 'sp-1-4-2.flv':
      Duration: 00:06:11.12, start: 0.000000, bitrate: 128 kb/s
        Stream #0.0: Video: vp6f, yuv420p, 640x480, 29.97 tb(r)
        Stream #0.1: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s
    How can I join these FLVs together into one large FLV? I know this is a common question, but some differences in my case:
    • This is Linux and command-line-only at that, which limits me mostly to either ffmpeg or mencoder.
    • FLVs can't be simply concatenated so a byte-for-byte copy doesn't work.
    • I've tried: mencoder -oac copy -ovc copy -idx -o foo.flv 1.flv 2.flv 3.flv ... but the resulting file has no video stream and the audio is completely garbled.
    • I've also tried ffmpeg's own example of how to join FLVs (http://ffmpeg.mplayerhq.hu/faq.html#SEC31) but the resulting file doesn't seek, so playback is incredibly slow for anything but starting at the beginning.
    • And finally, I've tried mencoder -fps 29.97 1.flv -fps 29.97 2.flv -fps 29.97 3.flv ... out.flv -of lavf -ovc copy -oac copy but the resulting file, while seekable, is occasionally garbled visually and also occasionally has random audio chirps and noise; the original FLVs don't.

    I'm fine with ending up with a different container like AVI or MKV but my objective is to not convert the video or audio streams themselves to other formats; I don't want to lose any quality in the process as they're already compressed to a decent extent, and compressing them further won't look so good.

    Would demuxing the FLVs, concatenating the audio and video streams, and then remuxing them work for me? The FLV joining in the ffmpeg FAQ implies that's the process, only they're using pipes to do it in real-time rather than using temporary files.

    Any help?
    Quote Quote  
  2. Member
    Join Date
    Oct 2008
    Location
    United States
    Search Comp PM
    FWIW, this seems to work:

    avidemux2_cli --audio-codec copy --video-codec copy --output-format avi --load 1.flv --append 2.flv --append 3.flv --save out.avi

    It crashes if I try MKV but I can live with an AVI container.

    edit: I take it back. The audio lags badly towards the end of the merged file.
    Quote Quote  
  3. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    Originally Posted by filburt1
    The audio lags badly towards the end of the merged file.
    I don't use these tools, but in converting FLV I've found you have to explicitly set the fps, some apps seem to misread it from the file, and thus when writing it out go out of sync.
    Quote Quote  
  4. Member
    Join Date
    Oct 2008
    Location
    United States
    Search Comp PM
    I've seen the same thing, but it looks like avidemux either ignores the argument or isn't affected by it; --fps 29.97 has no effect.

    The documentation for command-line arguments for more advanced changes is terrible, the Berlios SVN server is down so I can't compile a newer version, and the latest tarball of source code requires X to build even though I don't have it (nor do I need it).

    Agh!
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!