[FFmpeg-user] Possible feature additions for concatenating video files

Geek.Song ffmpeg at gmail.com
Thu Jan 5 04:29:39 CET 2012

I write a program based on 'ffmpeg.c' to perform media concatenation.

The only thing you need pay more attention: re-calculate the timestamp
(PTS and DTS)  to make sure the timestamp increasingly

On Thu, Jan 5, 2012 at 4:58 AM,  <dg1727 at hushmail.com> wrote:
> Hello,
> I am trying to concatenate (on Ubuntu Linux), without transcoding,
> some FLV files which have H.264 video and AAC audio.  They were
> originally split from a longer video, so the frame rates must have
> been the same originally.
> First I changed the container from FLV to MP4 [1] as follows:
> for f in *.flv; do \
> ffmpeg -i "$f" -vcodec copy -acodec copy "${f%.flv}.mp4"; \
> done
> Next, I tried to concatenate the MP4 files using MP4Box.  The
> resulting file had the audio out of sync with the video.  Then I
> found, using "MP4Box -info", that the audio duration of each file
> was different from the video duration, so [2] MP4Box didn't
> concatenate the videos in the way I expected.
> I browsed the discussion in [3], which told me that sometimes the
> video-frames-per-second field of a video file is in error so that
> software computes the wrong video duration from this field.
> Indeed, calculating from the audio duration of one of my files
> produced a video FPS of about 24.9787 instead of the 25.0000
> indicated by the reported video duration.  It seems like 24.9787 is
> the correct value.  I then thought of the following proposed
> feature:
> A.  An option in FFmpeg to assume that the input file is correct
> (audio and video have the same duration) except that only the video-
> FPS field is wrong.  This option would change only the video-FPS
> field to make the computed video duration match the audio duration.
>  Preferably, this option could be given to the "ffmpeg" command in
> the FLV-to-MP4 step listed above.
> Also, I found a couple of software tools that gave me warnings
> like, "This file uses H.264.  If there are B-frames, something may
> not work right."  So I would also like the following feature:
> B.  A feature (maybe in ffprobe?) which reports the total number of
> I-frames, P-frames, and B-frames in a given video stream (any
> format, not just H.264).  This way, if the file has no B-frames, I
> can happily use tools on it that warn me that B-frames may cause
> problems.
> Do proposed features A and B already exist?  If not, should I make
> tickets in Trac to request that these features be added to FFmpeg?
> If these features exist in software other than FFmpeg, I would be
> interested to know that, but I would still like these features to
> be in FFmpeg to make it more of a "one-stop shop."  I hope these
> features would not be hard to add to FFmpeg anyway.
> I appreciate any comments.
> [1] http://ubuntuforums.org/showthread.php?t=1687798&page=2
> [2] comment 5 on
> http://sourceforge.net/projects/gpac/forums/forum/287547/topic/48156
> 01
> [3] http://forum.doom9.org/archive/index.php/t-157642.html
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user

My key fingerprint: d1:03:f5:32:26:ff:d7:3c:e4:42:e3:51:ec:92:78:b2

More information about the ffmpeg-user mailing list