Encoding PAL over MPEG-TS with VLC
Or: "Using VLC to generate a PAL MPEG-2 Transport Stream (TS) carried over RTP"
Multiple setting combinations are described here. It is the intention that you save the combination of settings you want to a file, and use this file as a alternate config file for VLC.
Don't be alarmed, on first start, VLC will re-order the options, and all the default settings will be added as comments.
Under linux
vlc --config myconfig.cfg
If you want to change things interactively you can go the Tools ; Preferences
menu entry. (or Ctrl-P).
examples
An example to use VLC to send a 720x576@25 MPEG transport stream over RTP. The RTP destination is localhost:5001 for the complete stream.
sout-rtp-dst=localhost sout-rtp-mux=ts sout-rtp-port=5001 sout-rtp-ttl=1 sout-transcode-venc=avcodec sout-transcode-vcodec=mp2v sout-transcode-vb=1000 sout-transcode-fps=25.000000 sout-transcode-width=720 sout-transcode-height=576 sout-transcode-acodec=mpga sout-transcode-channels=2 sout-transcode-samplerate=44100 sout-transcode-high-priority=1 sout-ts-use-key-frames=1 sout-ts-crypt-audio=0 sout-ts-crypt-video=0 sout=#transcode:rtp sout-display=1 sout-keep=1 advanced=1
The sout-transcode-vb=1000
is important, otherwise you get very low bandwith video.
If you want manual assignments for the different packet streams you can add:
sout-ts-pid-video=100 sout-ts-pid-audio=101 sout-ts-pid-spu=102 sout-ts-pid-pmt=33
To specify the netid:
sout-ts-netid=1001
Encoding MPEG-TS PAL over RTP from the commandline
vlc -vvv --sout=#transcode{venc=ffmpeg{qscale=31},vcodec=mp2v,fps=25,width=720,height=576,acodec=mpga,ab=128,channels=2,samplerate=44100}:rtp{dst=localhost,port=5001,mux=ts{pid-video=162,pid-audio=88,pid-pmt=32},ttl=1} :sout-keep
qscale
For the qscale settings http://www.kilobitspersecond.com/2007/05/24/ffmpeg-quality-comparison/ might be of interest.