kkroening / ffmpeg-python

Python bindings for FFmpeg - with complex filtering support
Apache License 2.0
10.12k stars 893 forks source link

Converting bash script using mpegts ffmpeg. #562

Open SonnyWalkman opened 3 years ago

SonnyWalkman commented 3 years ago

Hello, Great work and I've playing with encoding h.264 with mpegts for DVB-T transmission. CBR How do I go about converting my bash script to python?

ffmpeg.out -loglevel error \ -rtmp_buffer 3000 \ -i rtmp://127.0.0.1:5000/static/feed \ -c:v libx264 \ -profile:v main -level 3.1 \ -preset veryfast \ -vf scale=704:576,setdar=dar=16/9 \ -c:a mp2 \ -b:a 128k \ -bsf:v h264_mp4toannexb \ -flush_packets 0 \ -f mpegts \ -muxrate 3M \ -pcr_period 20 \ -pat_period 0.10 \ -sdt_period 0.25 \ -metadata service_provider="My Provider" \ -metadata service_name="MyTV Channel" \ -metadata title="MyTV Channel" \ -metadata:s:a:0 language=eng \ -mpegts_flags +pat_pmt_at_frames \ udp://239.0.100.1:3000?pkt_size=1316\&bitrate=3000000\&overrun_nonfatal=1 \

McTwist commented 2 years ago

One parameter at a time. Some of them exist as functions, while most are used as optional parameters for them. If you want to use the same parameter more than once, (e.g. metadata) you may use global_args.