Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
howto:ffmpeg [2020/12/06 16:22] – ffmpeg renamed to howto:ffmpeg andihowto:ffmpeg [2026/07/26 22:17] (current) – external edit 127.0.0.1
Line 1: Line 1:
-ffmpeg+ffmpeg
  
 Siehe auch [[transcoding]] für Realtime-Stream-Transcoding-Kommandos Siehe auch [[transcoding]] für Realtime-Stream-Transcoding-Kommandos
  
-== repo+## repo
  
 stretch stretch
Line 14: Line 14:
  
  
-== compiling+## compiling
 <code>apt-get build-dep ffmpeg yasm libmp3lame-dev libx264-dev libvpx-dev libvorbis-dev libopus-dev</code> <code>apt-get build-dep ffmpeg yasm libmp3lame-dev libx264-dev libvpx-dev libvorbis-dev libopus-dev</code>
-=== für Debian+### für Debian
 debian multimedia einbinden (falls noch nicht passiert) debian multimedia einbinden (falls noch nicht passiert)
 <code>deb http://www.deb-multimedia.org wheezy main non-free <code>deb http://www.deb-multimedia.org wheezy main non-free
Line 36: Line 36:
 make install </code> make install </code>
  
-== audio channel mapping doku +## HD-Master mit Loudnorm
- +
-https://trac.ffmpeg.org/wiki/AudioChannelManipulation +
- +
- +
- +
-== silent fix+
 <code> <code>
-ffmpeg -ar 48000 -acodec pcm_s16le -f s16le -ac 2 -i <( dd if=/dev/zero ) --i not_silent/$file  -t 10.0 -c:v copy $file+ffmpeg -y \ 
-</code>+-i /video/intros/XXX/intro.ts -analyzeduration 20000000 \ 
 +-ss 1858.48 -t 3550.88 -i /video/fuse//XXX/YYY/ZZZ/uncut.ts -analyzeduration 20000000 \ 
 +-i /video/intros/XXX/outro.ts \ 
 +-filter_complex ' 
 +  [0:a:0] loudnorm=i=-16:print_format=summary [norm-0-0]; 
 +  [1:a:0] loudnorm=i=-16:print_format=summary [norm-1-0]
 +  [2:a:0] loudnorm=i=-16:print_format=summary [norm-2-0];
  
-Oder "schöner" und ohne knacken: +  [0:v:0] [norm-0-0] [1:v:0] [norm-1-0] [2:v:0] [norm-2-0] concat=n=3:v=1:a=1 [vd] [audio0_mix]; 
- +  [vd] yadif=mode=0:parity=0, hqdn3d [v] 
-<code> +' -analyzeduration 20000000/ 
-ffmpeg -i not_silent/$file -filter_complex "aevalsrc=c=2c:s=48000:0|0 [a]-map 0:v -c:v copy -map "[a]-c:a $audiocodec -shortest $outputfile+-map '[v]' -c:v:0 libx264 -pix_fmt yuv420p -crf:0 23 -profile:0 high -level:0 4.1 
 +-map '[audio0_mix]-c:a:0 aac -b:a:0 192k -ar:a:0 48000 \ 
 +-aspect 16:9 -movflags faststart -f mp4 /video/tmp/XXX/ZZZ-hd.mp4
 </code> </code>
-$audiocodec z.B. mp2 bei Intros 
-== metadata fix 
  
-=== map metadata and fix spezific entry+### HD-Master mit Loudnorm, Pause rausschneiden 
 + - Zeitstempel *Sekunden.Frames* 
 + - -t gibt Duration an, nicht Ende!
  
 <code> <code>
-ffmpeg -i br0ken_licence/$file +ffmpeg -y \ 
-  -map_metadata 0 +-i /video/intros/XXX/intro.ts -analyzeduration 20000000 
-  -metadata:s:a:0 LICENSE="Licensed to the public under https://creativecommons.org/licenses/by/2.0/de/ - http://media.ccc.de" +-ss 1858.48 -t 3550.88 -i /video/fuse//XXX/YYY/ZZZ/uncut.ts -analyzeduration 20000000 
-  -c:a copy $file +-ss 1858.48 -t 3550.88 -i /video/fuse//XXX/YYY/ZZZ/uncut.ts -analyzeduration 20000000 \ 
-</code>+-i /video/intros/XXX/outro.ts \ 
 +-filter_complex ' 
 +  [0:a:0] loudnorm=i=-16:print_format=summary [norm-0-0]; 
 +  [1:a:0] loudnorm=i=-16:print_format=summary [norm-1-0]; 
 +  [2:a:0] loudnorm=i=-16:print_format=summary [norm-2-0]; 
 +  [3:a:0] loudnorm=i=-16:print_format=summary [norm-3-0];
  
-=== copy metadata from another file +  [0:v:0] [norm-0-0] [1:v:0] [norm-1-0] [2:v:0] [norm-2-0] [3:v:0] [norm-3-0] concat=n=4:v=1:a=1 [vd] [audio0_mix]; 
- +  [vd] yadif=mode=0:parity=0, hqdn3d [v] 
-<code> +' -analyzeduration 20000000/ 
-ffmpeg -i $metadata_source -i $video_source -map 1 -c copy -map_metadata $output_file+-map '[v]' -c:v:0 libx264 -pix_fmt yuv420p -crf:0 23 -profile:0 high -level:0 4.1 
 +-map '[audio0_mix]' -c:a:0 aac -b:a:192k -ar:a:0 48000 \ 
 +-aspect 16:9 -movflags faststart -f mp4 /video/tmp/XXX/ZZZ-hd.mp4
 </code> </code>
  
-== one input, multiple format outputs +## encoding snippets
  
-1. h264/aac flv rtmp output +### H264/AAC/Stereo
-2. theora/vorbis ogg output +
- +
-<code> +
-ffmpeg -re -i 29c3-5266-de-en-proximax_telex_flashproxy_h264.mp4 -threads 0 -pix_fmt yuv420p -profile:v baseline -preset fast -tune zerolatency -c:v libx264 -strict -2 -c:a aac \ +
--f flv rtmp://localhost:1935/stream/saal1 \ +
--map 0 -c:v libtheora -c:a libvorbis -f ogg - | oggfwd localhost 8000 … +
-</code> +
- +
-== Audiospur via Backup Audioaufnahme reparieren und in MP4 packen +
- +
-Sprache deu-backup im Tracker anlegen. +
-Nochmal neu rausrendern lassen. +
- +
-einzelne Audiopuren vor oder nach Auphnic so umwandeln das Audio-Schnitt Tool wie z.B. Reaper was damit anfangen kann: +
- +
-  ffmpeg -i 5100-hd-audio2-auphonic.m4a -vn -c:a copy -bsf:a aac_adtstoasc 5100-hd-audio2-auphonic-echt.m4a +
-  ffmpeg -i 5100-hd-audio2-auphonic.m4a -vn -c:a copy -bsf:a aac_adtstoasc 5100-hd-audio2-auphonic-echt.m4a +
- +
- +
-Fertige Audiospur in Reaper rausrechnen, z.B. als Flac +
- +
-Audiospur wieder in Vortrag MP4 einpacken: +
- +
-<code> +
-ffmpeg -threads 0 -i /video/encoded/fossgis16/5100-hd-primary-audio-only.mp4 -i 5100-audio-fixed.flac -map 0:0 -map 1:0 -map_metadata 0 -c:v copy -c:a:0 libfdk_aac -vbr 4 -ar:a:0 48000  -metadata:s:a:0 language=deu 5100-hd-fixed2.mp4  +
-</code> +
- +
-Alte Version +
-<code> +
-ffmpeg -threads 0 -i 5100-hd.mp4  -i 5100-audio-fixed.flac -map 0:0 -map 1:0 -map_metadata 1 5100-hd-fixed.mp4 +
-</code> +
- +
- +
-Anmerkung: Geht auch mit MTS Datei (Transportstream mit H264 Video) der so aus der Consumer-Kamera auf die SD Karte fällt. +
- +
-Siehe auch: https://trac.ffmpeg.org/wiki/AudioChannelManipulation +
-== Audiospur(en) und Videospur vertauscht +
-<code> +
-ffmpeg -i 5115-hd-broken.mp4 -map 0:v -map 0:a -c copy -map_metadata 0 5115-hd.mp4 +
-</code> +
- +
-== Translated Transcoding +
- +
-<code> +
-ffmpeg -y -i rtmp://live.lan.c3voc.de/stream/mastermaster -aspect 16:9 -threads:0 0 -c:v libx264 -filter_complex '[0:v] yadif, scale=1920:1080 [v]; [0:a:0] pan=stereo|c0=FL [native]'  -map '[native]'  -map '[v]' -maxrate:v:0 2800k -bufsize:v:0 8192k -crf:0 18 -pix_fmt:0 yuv420p -profile:v:0 main -g:v:0 25 -preset:v:0 veryfast -ac 1 -y -f flv rtmp://live.lan.c3voc.de/push/master_translated_hd +
-</code> +
-== encoding snippets +
- +
-=== H264/AAC/Stereo+
  
 <code> <code>
Line 133: Line 93:
   -metadata title="<title>" \   -metadata title="<title>" \
     -metadata album="<album>" \     -metadata album="<album>" \
-    -metadata copyright="Licensed to the public under http://creativecommons.org/licenses/by-sa/3.0/" \+    -metadata copyright="This work is licensed under a Creative Commons Attribution 4.0 International License. https://creativecommons.org/licenses/by/4.0/" \
   <output-file-name>   <output-file-name>
 </code> </code>
Line 139: Line 99:
 **Videofilter:** ''hqdn3d'' for denoising, ''yadif'' for deinterlacing. If both, combine them with a comma.  **Videofilter:** ''hqdn3d'' for denoising, ''yadif'' for deinterlacing. If both, combine them with a comma. 
  
-=== H264/AAC HQ+### H264/AAC HQ
  
 <code> <code>
Line 146: Line 106:
   -c:a libfdk_aac -b:a 192k -aspect 16:9 -metadata title="<title>" \   -c:a libfdk_aac -b:a 192k -aspect 16:9 -metadata title="<title>" \
     -metadata album="<album>" \     -metadata album="<album>" \
-    -metadata copyright="Licensed to the public under http://creativecommons.org/licenses/by-sa/3.0/" \+    -metadata copyright="This work is licensed under a Creative Commons Attribution 4.0 International License. https://creativecommons.org/licenses/by/4.0/" \
     -f mp4 -movflags faststart <output-file-name>     -f mp4 -movflags faststart <output-file-name>
 </code> </code>
  
 **Videofilter:** ''hqdn3d'' for denoising, ''yadif'' for deinterlacing. If both, combine them with a comma.  **Videofilter:** ''hqdn3d'' for denoising, ''yadif'' for deinterlacing. If both, combine them with a comma. 
-=== WebM+### WebM
  
 <code>#!/bin/bash <code>#!/bin/bash
Line 173: Line 133:
   -aspect  16:9  -f  webm $target </code>   -aspect  16:9  -f  webm $target </code>
  
-=== FullHD+### FullHD
  
 Die Bitraten sind für Konferenz-Content (wenig Bewegung) in SD 16:9 (1024x576) getestet. Für HD-Content (1920x1080) haben wir beide Bitraten auf -maxrate:0 5000k gesetzt. Die Bitraten sind für Konferenz-Content (wenig Bewegung) in SD 16:9 (1024x576) getestet. Für HD-Content (1920x1080) haben wir beide Bitraten auf -maxrate:0 5000k gesetzt.
  
-=== WebCut LoRes MP4+### WebCut LoRes MP4
  
  
Line 200: Line 160:
 </code> </code>
  
-=== Pause rausschneiden+ 
 +## one input, multiple format outputs 
 + 
 +1. h264/aac flv rtmp output 
 +2. theora/vorbis ogg output 
 + 
 +<code> 
 +ffmpeg -re -i 29c3-5266-de-en-proximax_telex_flashproxy_h264.mp4 -threads 0 -pix_fmt yuv420p -profile:v baseline -preset fast -tune zerolatency -c:v libx264 -strict -2 -c:a aac \ 
 +-f flv rtmp://localhost:1935/stream/saal1 \ 
 +-map 0 -c:v libtheora -c:a libvorbis -f ogg - | oggfwd localhost 8000 … 
 +</code> 
 + 
 + 
 +## Translated Transcoding 
 + 
 +<code> 
 +ffmpeg -y -i rtmp://live.lan.c3voc.de/stream/mastermaster -aspect 16:9 -threads:0 0 -c:v libx264 -filter_complex '[0:v] yadif, scale=1920:1080 [v]; [0:a:0] pan=stereo|c0=FL [native]'  -map '[native]'  -map '[v]' -maxrate:v:0 2800k -bufsize:v:0 8192k -crf:0 18 -pix_fmt:0 yuv420p -profile:v:0 main -g:v:0 25 -preset:v:0 veryfast -ac 1 -y -f flv rtmp://live.lan.c3voc.de/push/master_translated_hd 
 +</code> 
 + 
 + 
 +## Audiospur via Backup Audioaufnahme reparieren und in MP4 packen 
 + 
 +Sprache deu-backup im Tracker anlegen. 
 +Nochmal neu rausrendern lassen. 
 + 
 +einzelne Audiopuren vor oder nach Auphnic so umwandeln das Audio-Schnitt Tool wie z.B. Reaper was damit anfangen kann: 
 + 
 +  ffmpeg -i 5100-hd-audio2-auphonic.m4a -vn -c:a copy -bsf:a aac_adtstoasc 5100-hd-audio2-auphonic-echt.m4a 
 +  ffmpeg -i 5100-hd-audio2-auphonic.m4a -vn -c:a copy -bsf:a aac_adtstoasc 5100-hd-audio2-auphonic-echt.m4a 
 + 
 + 
 +Fertige Audiospur in Reaper rausrechnen, z.B. als Flac 
 + 
 +Audiospur wieder in Vortrag MP4 einpacken: 
 + 
 +<code> 
 +ffmpeg -threads 0 -i /video/encoded/fossgis16/5100-hd-primary-audio-only.mp4 -i 5100-audio-fixed.flac -map 0:0 -map 1:0 -map_metadata 0 -c:v copy -c:a:0 libfdk_aac -vbr 4 -ar:a:0 48000  -metadata:s:a:0 language=deu 5100-hd-fixed2.mp4  
 +</code> 
 + 
 +Alte Version 
 +<code> 
 +ffmpeg -threads 0 -i 5100-hd.mp4  -i 5100-audio-fixed.flac -map 0:0 -map 1:0 -map_metadata 1 5100-hd-fixed.mp4 
 +</code> 
 + 
 + 
 +Anmerkung: Geht auch mit MTS Datei (Transportstream mit H264 Video) der so aus der Consumer-Kamera auf die SD Karte fällt. 
 + 
 +Siehe auch: https://trac.ffmpeg.org/wiki/AudioChannelManipulation 
 + 
 + 
 +## Audiospur(en) und Videospur vertauscht 
 +<code> 
 +ffmpeg -i 5115-hd-broken.mp4 -map 0:v -map 0:a -c copy -map_metadata 0 5115-hd.mp4 
 +</code> 
 + 
 + 
 + 
 + 
 +## audio channel mapping / repair 
 + 
 +https://trac.ffmpeg.org/wiki/AudioChannelManipulation 
 + 
 + 
 +### mono mixdown 
 + 
 +  ffmpeg -i 27-hd-orig.mp4 -codec:v copy -map_metadata 0 -ac 1 -ab 128k 27-hd.mp4 
 + 
 + 
 +### silent fix 
 +<code> 
 +ffmpeg -ar 48000 -acodec pcm_s16le -f s16le -ac 2 -i <( dd if=/dev/zero ) -y -i not_silent/$file  -t 10.0 -c:v copy $file; 
 +</code> 
 + 
 +Oder "schöner" und ohne knacken: 
 + 
 +<code> 
 +ffmpeg -i not_silent/$file -filter_complex "aevalsrc=c=2c:s=48000:0|0 [a]" -map 0:v -c:v copy -map "[a]" -c:a $audiocodec -shortest $outputfile 
 +</code> 
 +$audiocodec z.B. mp2 bei Intros 
 + 
 + 
 +## metadata fix 
 + 
 +### map metadata and fix specific entry 
 + 
 +<code> 
 +ffmpeg -i br0ken_licence/$file \ 
 +  -map_metadata 0 \ 
 +  -metadata:s:a:0 LICENSE="This work is licensed under a Creative Commons Attribution 4.0 International License. https://creativecommons.org/licenses/by/4.0/"
 +  -c:a copy $file 
 +</code> 
 + 
 +### copy metadata from another file 
 + 
 +<code> 
 +ffmpeg -i $metadata_source -i $video_source -map 1 -c copy -map_metadata 0 $output_file 
 +</code> 
 + 
 +### Pause rausschneiden
 Pause von 3840s = 1h04m00s Pause von 3840s = 1h04m00s
 bis 4691s = 1h18m11s bis 4691s = 1h18m11s
Line 214: Line 272:
     " -map '[v]' -c:v:0 libx264 -pix_fmt yuv420p -bufsize:0 8192k -crf:0 20 -minrate:0 100k -maxrate:0 5000k -profile:0 main -level:0 4.0 -threads 8 -map '[a]' -c:a:0 libfdk_aac -b:a:0 192k -ac:a:0 1 -ar:a:0 48000 -aspect 16:9 -f mp4 50-hd-camonly-cut.mp4     " -map '[v]' -c:v:0 libx264 -pix_fmt yuv420p -bufsize:0 8192k -crf:0 20 -minrate:0 100k -maxrate:0 5000k -profile:0 main -level:0 4.0 -threads 8 -map '[a]' -c:a:0 libfdk_aac -b:a:0 192k -ac:a:0 1 -ar:a:0 48000 -aspect 16:9 -f mp4 50-hd-camonly-cut.mp4
          
-=== HD-Master mit Loudnorm 
-<code> 
-ffmpeg -y \ 
--i /video/intros/XXX/intro.ts -analyzeduration 20000000 \ 
--ss 1858.48 -t 3550.88 -i /video/fuse//XXX/YYY/ZZZ/uncut.ts -analyzeduration 20000000 \ 
--i /video/intros/XXX/outro.ts \ 
--filter_complex ' 
-  [0:a:0] loudnorm=i=-16:print_format=summary [norm-0-0]; 
-  [1:a:0] loudnorm=i=-16:print_format=summary [norm-1-0]; 
-  [2:a:0] loudnorm=i=-16:print_format=summary [norm-2-0]; 
  
-  [0:v:0] [norm-0-0] [1:v:0] [norm-1-0] [2:v:0] [norm-2-0] concat=n=3:v=1:a=1 [vd] [audio0_mix]; +### Icecast-Audio mit ffmpeg
-  [vd] yadif=mode=0:parity=0, hqdn3d [v] +
-' -analyzeduration 20000000/ +
--map '[v]' -c:v:0 libx264 -pix_fmt yuv420p -crf:0 23 -profile:0 high -level:0 4.1 +
--map '[audio0_mix]' -c:a:0 aac -b:a:0 192k -ar:a:0 48000 \ +
--aspect 16:9 -movflags faststart -f mp4 /video/tmp/XXX/ZZZ-hd.mp4 +
-</code> +
- +
-=== HD-Master mit Loudnorm, Pause rausschneiden +
- - Zeitstempel = *Sekunden.Frames* +
- - -t gibt Duration an, nicht Ende! +
- +
-<code> +
-ffmpeg -y \ +
--i /video/intros/XXX/intro.ts -analyzeduration 20000000 \ +
--ss 1858.48 -t 3550.88 -i /video/fuse//XXX/YYY/ZZZ/uncut.ts -analyzeduration 20000000 \ +
--ss 1858.48 -t 3550.88 -i /video/fuse//XXX/YYY/ZZZ/uncut.ts -analyzeduration 20000000 \ +
--i /video/intros/XXX/outro.ts \ +
--filter_complex ' +
-  [0:a:0] loudnorm=i=-16:print_format=summary [norm-0-0]; +
-  [1:a:0] loudnorm=i=-16:print_format=summary [norm-1-0]; +
-  [2:a:0] loudnorm=i=-16:print_format=summary [norm-2-0]; +
-  [3:a:0] loudnorm=i=-16:print_format=summary [norm-3-0]; +
- +
-  [0:v:0] [norm-0-0] [1:v:0] [norm-1-0] [2:v:0] [norm-2-0] [3:v:0] [norm-3-0] concat=n=4:v=1:a=1 [vd] [audio0_mix]; +
-  [vd] yadif=mode=0:parity=0, hqdn3d [v] +
-' -analyzeduration 20000000/ +
--map '[v]' -c:v:0 libx264 -pix_fmt yuv420p -crf:0 23 -profile:0 high -level:0 4.1 +
--map '[audio0_mix]' -c:a:0 aac -b:a:0 192k -ar:a:0 48000 \ +
--aspect 16:9 -movflags faststart -f mp4 /video/tmp/XXX/ZZZ-hd.mp4 +
-</code> +
-=== Icecast-Audio mit ffmpeg+
  
     ffmpeg -re -i … -map 0:a -c:a mp3 -f mp3 \     ffmpeg -re -i … -map 0:a -c:a mp3 -f mp3 \
Line 266: Line 283:
         icecast://source:…@live.ber.c3voc.de:8000/foo.mp3         icecast://source:…@live.ber.c3voc.de:8000/foo.mp3
    
-=== Geschnittenes Camera MTS mit Backup Ton zu Final MP4+### Geschnittenes Camera MTS mit Backup Ton zu Final MP4
  
   ffmpeg -analyzeduration 20000000 -i video-cut.mov \   ffmpeg -analyzeduration 20000000 -i video-cut.mov \
Line 280: Line 297:
   -f mp4 -metadata title=<TITEL> -metadata:s:a:0 language=deu -metadata:s:a:1 language=backup encoded/video.mp4   -f mp4 -metadata title=<TITEL> -metadata:s:a:0 language=deu -metadata:s:a:1 language=backup encoded/video.mp4
  
-== Poster Image + Audio zu Video+## Poster Image + Audio zu Video
  
 https://trac.ffmpeg.org/wiki/Create%20a%20video%20slideshow%20from%20images#Addingaudio https://trac.ffmpeg.org/wiki/Create%20a%20video%20slideshow%20from%20images#Addingaudio
Line 309: Line 326:
     ffmpeg -t 60 -loop 1 -i 0-pause.png  -c:v libx264 -tune stillimage -pix_fmt yuv420p -shortest -map 0:v -f mpegts pause.ts     ffmpeg -t 60 -loop 1 -i 0-pause.png  -c:v libx264 -tune stillimage -pix_fmt yuv420p -shortest -map 0:v -f mpegts pause.ts
  
-== Streamen von einer USB Webcam (720p no audio)+## Streamen von einer USB Webcam (720p no audio)
 <code> <code>
 ffmpeg2theora /dev/video1 -f video4linux2 -x 1280 -y 720 -F 30 -v 10 --pp fd --noaudio -o - | oggfwd <icecast ip> <port> <pw> /<mountpoint> ffmpeg2theora /dev/video1 -f video4linux2 -x 1280 -y 720 -F 30 -v 10 --pp fd --noaudio -o - | oggfwd <icecast ip> <port> <pw> /<mountpoint>
 </code> </code>
  
-== HLS streaming+## HLS streaming
 <code> <code>
 ffmpeg -i - -filter:v yadif -c:v dvvideo -c:a copy -f dv - | \ ffmpeg -i - -filter:v yadif -c:v dvvideo -c:a copy -f dv - | \
Line 332: Line 349:
 </code> </code>
  
-== Facebook Live-Streaming+## Facebook Live-Streaming
  
 Facebook will zwingend 720p, 30 fps und eine i-Frame-Intervall von 2 Sekunden bei max. 4000k Bitrate. Audio darf nur 44100KHz sein (Stereo ist aber erlaubt). Facebook will zwingend 720p, 30 fps und eine i-Frame-Intervall von 2 Sekunden bei max. 4000k Bitrate. Audio darf nur 44100KHz sein (Stereo ist aber erlaubt).
Line 349: Line 366:
  
  
-== Periscope Live-Streaming+## Periscope Live-Streaming
  
 Periscope Producer will [[https://help.pscp.tv/customer/en/portal/articles/2600293-what-is-periscope-producer|laut Anleitung]] zwingend 720p (stellt sich raus: sollen sogar nur 540p sein), 30 fps und eine i-Frame-Intervall von 3 Sekunden (2 sind besser und gehen auch) bei max. 4000k Bitrate. Audio darf nur 44100KHz sein (Stereo ist aber erlaubt). Periscope Producer will [[https://help.pscp.tv/customer/en/portal/articles/2600293-what-is-periscope-producer|laut Anleitung]] zwingend 720p (stellt sich raus: sollen sogar nur 540p sein), 30 fps und eine i-Frame-Intervall von 3 Sekunden (2 sind besser und gehen auch) bei max. 4000k Bitrate. Audio darf nur 44100KHz sein (Stereo ist aber erlaubt).
Line 357: Line 374:
 </code> </code>
  
-== ffmpeg h264 encoding+## ffmpeg h264 encoding
  
 <code> <code>
Line 372: Line 389:
 </code> </code>
  
-== Timestamp Stream overlay+## Timestamp Stream overlay
 localtime ffmpeg newest standard localtime ffmpeg newest standard
 <code> <code>
Line 384: Line 401:
 </code> </code>
  
-== Konvertiere externe Video-Dateien zu mpeg-Segmente die der Tracker versteht+## Konvertiere externe Video-Dateien zu mpeg-Segmente die der Tracker versteht
  
 In unserem [[https://github.com/voc/scripts/|scripts]]-Repositorie gibt es ein Skript [[https://github.com/voc/scripts/blob/master/camera_recordings_to_segments/cam2seg.sh|cam2seg.sh]] welches alle Dateien in einem Ordner in Segmente konvertiert, welche der Tracker verstehen kann. Das Skript bitte einmal ohne Argmuente aufrufen für weitere Instruktionen: ''sh cam2seg.sh''. In unserem [[https://github.com/voc/scripts/|scripts]]-Repositorie gibt es ein Skript [[https://github.com/voc/scripts/blob/master/camera_recordings_to_segments/cam2seg.sh|cam2seg.sh]] welches alle Dateien in einem Ordner in Segmente konvertiert, welche der Tracker verstehen kann. Das Skript bitte einmal ohne Argmuente aufrufen für weitere Instruktionen: ''sh cam2seg.sh''.
  
-== relaying a HLS stream to our cdn ( and fix most of the brokyness it comes with from "professional" CDNs )+## relaying a HLS stream to our cdn ( and fix most of the brokyness it comes with from "professional" CDNs )
 <code> <code>
 ffmpeg -headers 'User-Agent: bar'$'\r\n' -i http://yourBrokenCDN.com/stupidfilename.m3u8  -c:v copy -c:a aac -ar 44100 -ab 128k -ac 2 -strict -2  -bsf:a aac_adtstoasc -f flv rtmp://localhost:1935/test/q1   ffmpeg -headers 'User-Agent: bar'$'\r\n' -i http://yourBrokenCDN.com/stupidfilename.m3u8  -c:v copy -c:a aac -ar 44100 -ab 128k -ac 2 -strict -2  -bsf:a aac_adtstoasc -f flv rtmp://localhost:1935/test/q1  
Line 399: Line 416:
 streamlink -l debug https://www.youtube.com/watch?v=DeQkjJ9JJTI 720p --player="ffmpeg -c copy -bsf:a aac_adtstoasc -f flv rtmp://127.0.0.1:1935/live/irgendwas -i" streamlink -l debug https://www.youtube.com/watch?v=DeQkjJ9JJTI 720p --player="ffmpeg -c copy -bsf:a aac_adtstoasc -f flv rtmp://127.0.0.1:1935/live/irgendwas -i"
 </code> </code>
-== HLS Streamdump als Backup, gleich in Schnipseln+## HLS Streamdump als Backup, gleich in Schnipseln
  
 (Natürlich ist das dann H.264 in TS statt MPEG2 in TS, aber das sollte trotzdem alles funktionieren) (Natürlich ist das dann H.264 in TS statt MPEG2 in TS, aber das sollte trotzdem alles funktionieren)
Line 407: Line 424:
 </code> </code>
  
-== Blur eines Bildausschnitts (Rechteckiges Fenster der Größe $XSIZE und $YSIZE, mit Offset $XOFFSET und $YOFFSET, alles in Pixeln)+## Blur eines Bildausschnitts (Rechteckiges Fenster der Größe $XSIZE und $YSIZE, mit Offset $XOFFSET und $YOFFSET, alles in Pixeln)
  
 <code> <code>
Line 413: Line 430:
 </code> </code>
  
-== Schwarze Box / Black Box über einen Bildausschnitt legen+## Schwarze Box / Black Box über einen Bildausschnitt legen
  
 50 = Box-Breite, 40 = Box-Höhe, 5 = Box-X-Position, 4 = Box-Y-Position 50 = Box-Breite, 40 = Box-Höhe, 5 = Box-X-Position, 4 = Box-Y-Position
Line 421: Line 438:
 </code> </code>
  
-== Filter konkatenieren, hier: 2 Schwarze Boxen / Black Boxes über einen Bildausschnitt legen+## Filter konkatenieren, hier: 2 Schwarze Boxen / Black Boxes über einen Bildausschnitt legen
  
 Box 1 (z.B. Laufschrift-Balken) Box 1 (z.B. Laufschrift-Balken)
Line 433: Line 450:
 </code> </code>
  
-== RGB/YUV Blödsinn+## RGB/YUV Blödsinn
  
 Das ist alles sehr verwirrend, einfach beides probieren und das nehmen, was richtig aussieht. Das ist alles sehr verwirrend, einfach beides probieren und das nehmen, was richtig aussieht.
Line 447: Line 464:
 </code> </code>
  
-== AV sync test using ffmpeg / ffplay+## AV sync test using ffmpeg / ffplay
  
 This might be useful to find A/V drifting behavior in the production chain. Simply use this as the generator. For use as a source for our streaming relay: This might be useful to find A/V drifting behavior in the production chain. Simply use this as the generator. For use as a source for our streaming relay:
Line 467: Line 484:
 </code> </code>
  
-== ffmpeg only multiview+## ffmpeg only multiview
 <code> <code>
 #/bin/bash #/bin/bash
Line 527: Line 544:
 exit exit
 </code> </code>
-== DASH encoding +## DASH encoding 
-=== VOD encoding+### VOD encoding
  
 um static files in mehreren bitraten/aufloesungen nach DASH zu konvertieren. um static files in mehreren bitraten/aufloesungen nach DASH zu konvertieren.
Line 604: Line 621:
 </code> </code>
  
-=== screen capture and stream ===+### screen capture and stream
  
 <code> <code>
  • howto/ffmpeg.1607271749.txt.gz
  • Last modified: 2020/12/06 16:22
  • by andi