[FFmpeg-trac] #614(FFmpeg:new): mpegts issue on localhost

FFmpeg trac at avcodec.org
Sun Nov 6 13:23:35 CET 2011


#614: mpegts issue on localhost
--------------------------------------+---------------------------------
               Reporter:  burek       |                  Owner:  michael
                   Type:  defect      |                 Status:  new
               Priority:  normal      |              Component:  FFmpeg
                Version:  git-master  |               Keywords:
             Blocked By:              |               Blocking:
Reproduced by developer:  0           |  Analyzed by developer:  0
--------------------------------------+---------------------------------
 Hi,

 In response to https://ffmpeg.org/trac/ffmpeg/ticket/602 (cehoyos), I'll
 try to provide my experience with mpegts format.

 Here is the first issue. I have 2 ffmpeg processes, the first one should
 send the a/v (aac+h264) to the localhost:port using udp, and the 2nd
 ffmpeg process should pick it up and just save to the .ts file.

 This is the command line of the first ffmpeg:

 {{{
 ffmpeg -y -re \
         -f video4linux2 -r 30 -s qvga -i /dev/v4l/by-id/usb-
 046d_0809_33A881A3-video-index0 \
         -f alsa -ar 44100 -ac 2 -i default:CARD=Intel \
         -vcodec libx264 -crf 20 -threads 0 \
         -acodec aac -ab 32k -ar 44100 -ac 2 \
         -strict experimental \
         -vbsf h264_mp4toannexb \
         -absf aac_adtstoasc \
         -f mpegts udp://127.0.0.1:10001
 }}}

 And this is the command of the 2nd ffmpeg:

 {{{
 ffmpeg -muxdelay 15 -f mpegts -i udp://localhost:10001 -acodec copy
 -vcodec copy out.ts
 }}}

 Now, when I try to play the .ts file in VLC, I can watch the video, but in
 the message log I can see a lot of those:
 {{{
 main warning: late picture skipped (35805 > -268)
 main warning: late picture skipped (2472 > -268)
 main warning: late picture skipped (7218 > -262)
 main warning: late picture skipped (1171 > -334)
 main warning: late picture skipped (24818 > -266)
 main warning: late picture skipped (19257 > -277)
 main warning: late picture skipped (14977 > -303)
 main warning: late picture skipped (57074 > -266)
 main warning: late picture skipped (23740 > -266)
 main warning: late picture skipped (5374 > -265)
 main warning: late picture skipped (1929 > -15969)
 main warning: late picture skipped (1376 > -264)
 }}}

 I'm sure the network is not an issue here :) and also, I've monitored cpu
 usage (on a dual core) and it didn't go over 40% at any time.

 Also, when I record a live stream this way for a very long time (like 12
 hours or more) the audio and video get totally async, meaning audio is
 progressively advancing before the video and after like 3-4 hours of
 recording, the drift is around 10 seconds and will get even bigger for the
 longer period of the recording.

 I can send you samples of .ts files, only I'll need to record for that
 long, so you can see that it really happens.

 Other issues are related to remuxing from .ts to .flv (also with
 h264+aac), but I'll see to create new tickets for that.

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/614>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list