This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
ffmpeg [2024-06-03 22:23:43] mi |
ffmpeg [2025-03-20 19:39:18] (current) mi [Add pseudo-timecode] |
||
|---|---|---|---|
| Line 255: | Line 255: | ||
| for t in {0..11}; do ffmpeg -nostats -i "$in" -map 0:a:$t -filter_complex ebur128 -f null - > $(printf "ebur-$in-a%02d.txt" $t) 2>&1 ; done | for t in {0..11}; do ffmpeg -nostats -i "$in" -map 0:a:$t -filter_complex ebur128 -f null - > $(printf "ebur-$in-a%02d.txt" $t) 2>&1 ; done | ||
| + | |||
| + | |||
| + | ==Delay track | ||
| + | To add a delay to the start of an input, use ''-itsoffset offset'' before the input file. | ||
| + | |||
| + | See [[https://superuser.com/a/983153/53547|this answer]] for [[https://superuser.com/questions/982342/|In ffmpeg, how to delay only the audio of a .mp4 video without converting the audio?]] | ||
| + | |||
| + | For example, to merge an audio and a video file, but having the audio start 440 ms. later (11 frames at 25 fps): | ||
| + | |||
| + | ffmpeg -i "$video_file" -itsoffset 0.440 -i "$audio_file" -map 0:v -map 1:a -c copy "ff-resync-video_audio.mp4" | ||
| + | ===Syntax for time duration | ||
| + | ''[-][HH:]MM:SS[.m...]'' or ''[-]S+[.m...][s|ms|us]'' | ||
| + | See https://ffmpeg.org/ffmpeg-utils.html#time-duration-syntax | ||
| Line 273: | Line 286: | ||
| - | == Add pseudo-timecode | + | == Timecode |
| + | === Change existing timecode | ||
| + | |||
| + | f=OriginalFile.mxf | ||
| + | newtc="00:00:00:00" | ||
| + | out=NewTC_File.mxf | ||
| + | ffmpeg -i "$f" -map 0:v -map 0:a -codec copy -movflags use_metadata_tags -timecode "$newtc" "$out" | ||
| + | |||
| + | === Add pseudo-timecode | ||
| Example with Fuji .MOV files, to add the "Create Date" time as a timecode: | Example with Fuji .MOV files, to add the "Create Date" time as a timecode: | ||
| Line 304: | Line 325: | ||
| <code bash>t=$(exiftool -api largefilesupport=1 -CreateDate "$f" | awk '{print $NF}');</code> | <code bash>t=$(exiftool -api largefilesupport=1 -CreateDate "$f" | awk '{print $NF}');</code> | ||
| + | |||
| + | For .wav files from a Zoom, instead of ''-CreateDate'', use ''-DateTimeOriginal'' : | ||
| + | <code bash>t=$(exiftool -DateTimeOriginal "$f" | awk '{print $NF}'); tc="$t:00";</code> | ||
| ==Diff | ==Diff | ||