[FFmpeg-user] Transcoding a stream to Wowza through ffmpeg

Dan M dan at streemit.net
Thu Jul 5 15:20:28 CEST 2012

I have a remote server sending an MPEG2 stream to my ffmpeg machine. My 
ffmpeg machine is grabbing the stream, transcoding it, and sending it on 
to another machine running Wowza. The process is partially working.

As a first step towards getting this workflow running I configured 
ffmpeg to grab the stream, transcode it, and write to a disk file. I'm 
doing this with:
ffmpeg -strict -2 -i udp://@:5000 -acodec mp2 -ac 2 -b:v 8000k -ar 48k 
-async 1 -bufsize 3M -s 720x480 -r 31.67 -vcodec libx264 -y -f mp4 

The command I'm using and the output lines that appear are in the file 
at http://pastebin.com/LYjxaCZG. But to summarize, I get:
[mpegts @ 0x133eec0] Unable to seek back to the start
[mpeg2video @ 0x134f3c0] mpeg_decode_postinit() failure
     Last message repeated 6 times
[mpegts @ 0x133eec0] max_analyze_duration 5000000 reached at 5016000
[mpegts @ 0x133eec0] Estimating duration from bitrate, this may be 
Input #0, mpegts, from 'udp://@:5000':
   Duration: N/A, start: 35652.634867, bitrate: 8224 kb/s
   Program 1
     Stream #0:0[0x44]: Video: mpeg2video (Main) ([2][0][0][0] / 
0x0002), yuv420p, 720x480 [SAR 8:9 DAR 4:3], 8000 kb/s, 31.01 fps, 29.97 
tbr, 90k tbn, 59.94 tbc
     Stream #0:1[0x45]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, 
stereo, s16, 224 kb/s
[buffer @ 0x16a0320] w:720 h:480 pixfmt:yuv420p tb:1/1000000 sar:8/9 
[libx264 @ 0x1354d40] VBV maxrate unspecified, assuming CBR
[libx264 @ 0x1354d40] using SAR=8/9
[libx264 @ 0x1354d40] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
[libx264 @ 0x1354d40] profile High, level 3.1
[libx264 @ 0x1354d40] 264 - core 120 r2151 a3f4407 - H.264/MPEG-4 AVC 
codec - Copyleft 2003-2011 - http://www.videolan.org/x264.html - 
options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 
psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 
8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3 
sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 
constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 
weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 
intra_refresh=0 rc_lookahead=40 rc=cbr mbtree=1 bitrate=8000 ratetol=1.0 
qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=8000 vbv_bufsize=3000 
nal_hrd=none ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.mp4':
     encoder         : Lavf53.32.100
     Stream #0:0: Video: h264 (![0][0][0] / 0x0021), yuv420p, 720x480 
[SAR 8:9 DAR 4:3], q=-1--1, 8000 kb/s, 3167 tbn, 31.67 tbc
     Stream #0:1: Audio: mp2 (i[0][0][0] / 0x0069), 48000 Hz, 2 
channels, s16, 128 kb/s
Stream mapping:
   Stream #0:0 -> #0:0 (mpeg2video -> libx264)
   Stream #0:1 -> #0:1 (mp2 -> mp2)
Press [q] to stop, [?] for help
[mpeg2video @ 0x134f3c0] warning: first frame is no keyframe
     Last message repeated 1 times
circular_buffer: OVERRUN.0 size=    2581kB time=00:00:02.68 
bitrate=7876.8kbits/s dup=15 drop=0
PES packet size mismatch.0 size=    9309kB time=00:00:10.13 
bitrate=7523.6kbits/s dup=28 drop=0

When the "PES packet size mismatch" error occurs the output file stops 
growing. I'm assuming that I'm specifying some invalid parameters in my 
command line.

Any pointers on what I might be doing wrong?

More information about the ffmpeg-user mailing list