简体   繁体   中英

Encode input stream mpg2 to output stream h264 CBR

Output should be:
- 2,5 Mbit/s CBR H.264/mpeg4
- Audio 128kbit/s joint stereo mpeg2

Command i am using as last looks like this, and stream is not CBR.

ffmpeg.exe "udp://xxx.xx.xxx.x:xxxx?fifo_size=700000&buffer_size=12000k&pkt_size=1316" 
-vf "hqdn3d" -c:v libx264 -refs 4 
-minrate:v 2500k -me_method hex -maxrate 2500k -sc_threshold 45 -bufsize 300k -b:v 2500k-bsf 
h264_mp4toannexb -flags +ilme+ildct+loop+mv4+cgop -profile:v baseline 
-x264opts 8x8dct -x264opts mixed-refs -x264opts weightp=0 -g 100 
-c:a mp2 -ab 128k -ar 48000 -fflags +igndts+genpts+sortdts -f mpegts 
"udp://@xxx.xxx.x.x:xxxx?buffer_size=100k&pkt_size=1316" -threads 0 -v 0

Try

ffmpeg "udp://xxx.xx.xxx.x:xxxx?fifo_size=700000&buffer_size=12000k&pkt_size=1316" 
-vf "hqdn3d" -me_method hex -sc_threshold 45 -refs 4 -flags +ilme+ildct+loop+mv4+cgop -g 100
-c:v libx264 -minrate:v 2300k -maxrate 2372k -bufsize 2400k -b:v 2300k
-bsf h264_mp4toannexb -profile:v baseline 
-x264opts mixed-refs:weightp=0:nal-hrd=cbr  
-c:a mp2 -ab 128k -ar 48000 -fflags +igndts+genpts+sortdts
-threads 0 -v 0
-f mpegts -muxrate 2500k "udp://@xxx.xxx.x.x:xxxx?buffer_size=100k&pkt_size=1316" 

Added nal-hrd=cbr to x264opts and removed 8x8dct which is used in High profile.

If your input is interlaced, deinterlace it (add yadif filter).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM