Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
| howto:ffmpeg [2023/06/10 22:58] – [audio channel mapping / repair] andi | howto: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 |
| < | < | ||
| - | === für Debian | + | ### für Debian |
| debian multimedia einbinden (falls noch nicht passiert) | debian multimedia einbinden (falls noch nicht passiert) | ||
| < | < | ||
| Line 36: | Line 36: | ||
| make install </ | make install </ | ||
| - | == HD-Master mit Loudnorm | + | ## HD-Master mit Loudnorm |
| < | < | ||
| ffmpeg -y \ | ffmpeg -y \ | ||
| Line 55: | Line 55: | ||
| </ | </ | ||
| - | === HD-Master mit Loudnorm, Pause rausschneiden | + | ### HD-Master mit Loudnorm, Pause rausschneiden |
| - Zeitstempel = *Sekunden.Frames* | - Zeitstempel = *Sekunden.Frames* | ||
| - -t gibt Duration an, nicht Ende! | - -t gibt Duration an, nicht Ende! | ||
| Line 79: | Line 79: | ||
| </ | </ | ||
| - | == encoding snippets | + | ## encoding snippets |
| - | === H264/ | + | ### H264/ |
| < | < | ||
| Line 99: | Line 99: | ||
| **Videofilter: | **Videofilter: | ||
| - | === H264/AAC HQ | + | ### H264/AAC HQ |
| < | < | ||
| Line 111: | Line 111: | ||
| **Videofilter: | **Videofilter: | ||
| - | === WebM | + | ### WebM |
| < | < | ||
| Line 133: | Line 133: | ||
| -aspect | -aspect | ||
| - | === 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 161: | Line 161: | ||
| - | == one input, multiple format outputs | + | ## one input, multiple format outputs |
| 1. h264/aac flv rtmp output | 1. h264/aac flv rtmp output | ||
| Line 173: | Line 173: | ||
| - | == Translated Transcoding | + | ## Translated Transcoding |
| < | < | ||
| Line 180: | Line 180: | ||
| - | == Audiospur via Backup Audioaufnahme reparieren und in MP4 packen | + | ## Audiospur via Backup Audioaufnahme reparieren und in MP4 packen |
| Sprache deu-backup im Tracker anlegen. | Sprache deu-backup im Tracker anlegen. | ||
| Line 210: | Line 210: | ||
| - | == Audiospur(en) und Videospur vertauscht | + | ## Audiospur(en) und Videospur vertauscht |
| < | < | ||
| ffmpeg -i 5115-hd-broken.mp4 -map 0:v -map 0:a -c copy -map_metadata 0 5115-hd.mp4 | ffmpeg -i 5115-hd-broken.mp4 -map 0:v -map 0:a -c copy -map_metadata 0 5115-hd.mp4 | ||
| Line 218: | Line 218: | ||
| - | == audio channel mapping / repair | + | ## audio channel mapping / repair |
| https:// | https:// | ||
| - | === mono mixdown | + | ### mono mixdown |
| ffmpeg -i 27-hd-orig.mp4 -codec:v copy -map_metadata 0 -ac 1 -ab 128k 27-hd.mp4 | ffmpeg -i 27-hd-orig.mp4 -codec:v copy -map_metadata 0 -ac 1 -ab 128k 27-hd.mp4 | ||
| - | === silent fix | + | ### silent fix |
| < | < | ||
| ffmpeg -ar 48000 -acodec pcm_s16le -f s16le -ac 2 -i <( dd if=/ | ffmpeg -ar 48000 -acodec pcm_s16le -f s16le -ac 2 -i <( dd if=/ | ||
| Line 241: | Line 241: | ||
| - | == metadata fix | + | ## metadata fix |
| - | === map metadata and fix specific entry | + | ### map metadata and fix specific entry |
| < | < | ||
| Line 252: | Line 252: | ||
| </ | </ | ||
| - | === copy metadata from another file | + | ### copy metadata from another file |
| < | < | ||
| Line 258: | Line 258: | ||
| </ | </ | ||
| - | === Pause rausschneiden | + | ### Pause rausschneiden |
| Pause von 3840s = 1h04m00s | Pause von 3840s = 1h04m00s | ||
| bis 4691s = 1h18m11s | bis 4691s = 1h18m11s | ||
| Line 273: | Line 273: | ||
| | | ||
| - | === Icecast-Audio mit ffmpeg | + | ### 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 283: | Line 283: | ||
| icecast:// | icecast:// | ||
| - | === 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 297: | Line 297: | ||
| -f mp4 -metadata title=< | -f mp4 -metadata title=< | ||
| - | == Poster Image + Audio zu Video | + | ## Poster Image + Audio zu Video |
| https:// | https:// | ||
| Line 326: | Line 326: | ||
| ffmpeg -t 60 -loop 1 -i 0-pause.png | ffmpeg -t 60 -loop 1 -i 0-pause.png | ||
| - | == Streamen von einer USB Webcam (720p no audio) | + | ## Streamen von einer USB Webcam (720p no audio) |
| < | < | ||
| ffmpeg2theora /dev/video1 -f video4linux2 -x 1280 -y 720 -F 30 -v 10 --pp fd --noaudio -o - | oggfwd <icecast ip> < | ffmpeg2theora /dev/video1 -f video4linux2 -x 1280 -y 720 -F 30 -v 10 --pp fd --noaudio -o - | oggfwd <icecast ip> < | ||
| </ | </ | ||
| - | == HLS streaming | + | ## HLS streaming |
| < | < | ||
| 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 349: | Line 349: | ||
| </ | </ | ||
| - | == 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 366: | Line 366: | ||
| - | == Periscope Live-Streaming | + | ## Periscope Live-Streaming |
| Periscope Producer will [[https:// | Periscope Producer will [[https:// | ||
| Line 374: | Line 374: | ||
| </ | </ | ||
| - | == ffmpeg h264 encoding | + | ## ffmpeg h264 encoding |
| < | < | ||
| Line 389: | Line 389: | ||
| </ | </ | ||
| - | == Timestamp Stream overlay | + | ## Timestamp Stream overlay |
| localtime ffmpeg newest standard | localtime ffmpeg newest standard | ||
| < | < | ||
| Line 401: | Line 401: | ||
| </ | </ | ||
| - | == 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:// | In unserem [[https:// | ||
| - | == relaying a HLS stream to our cdn ( and fix most of the brokyness it comes with from " | + | ## relaying a HLS stream to our cdn ( and fix most of the brokyness it comes with from " |
| < | < | ||
| ffmpeg -headers ' | ffmpeg -headers ' | ||
| Line 416: | Line 416: | ||
| streamlink -l debug https:// | streamlink -l debug https:// | ||
| </ | </ | ||
| - | == 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 424: | Line 424: | ||
| </ | </ | ||
| - | == 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) |
| < | < | ||
| Line 430: | Line 430: | ||
| </ | </ | ||
| - | == 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, | 50 = Box-Breite, 40 = Box-Höhe, 5 = Box-X-Position, | ||
| Line 438: | Line 438: | ||
| </ | </ | ||
| - | == Filter konkatenieren, | + | ## Filter konkatenieren, |
| Box 1 (z.B. Laufschrift-Balken) | Box 1 (z.B. Laufschrift-Balken) | ||
| Line 450: | Line 450: | ||
| </ | </ | ||
| - | == 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 464: | Line 464: | ||
| </ | </ | ||
| - | == 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 484: | Line 484: | ||
| </ | </ | ||
| - | == ffmpeg only multiview | + | ## ffmpeg only multiview |
| < | < | ||
| #/bin/bash | #/bin/bash | ||
| Line 544: | Line 544: | ||
| exit | exit | ||
| </ | </ | ||
| - | == DASH encoding | + | ## DASH encoding |
| - | === VOD encoding | + | ### VOD encoding |
| um static files in mehreren bitraten/ | um static files in mehreren bitraten/ | ||
| Line 621: | Line 621: | ||
| </ | </ | ||
| - | === screen capture and stream | + | ### screen capture and stream |
| < | < | ||