Skip to content

Instantly share code, notes, and snippets.

@emcodem
emcodem / concat.txt
Created April 15, 2024 21:53
ffmpeg concat testing
XDCAMHD:
transcode 2 clips (closed GOP), then stitch with codec copy:
Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 47
@emcodem
emcodem / mpv 10bit wfm.txt
Created April 12, 2024 16:55
mpv 10bit wfm
C:\Users\Gam3r1\mpv.exe --lavfi-complex="[vid1]sidedata=delete,metadata=delete,yadif=deint=1,scale=1920:1080,pad=1920:1080:-1:-1:color=2D3039[vid_right_border],[vid_right_border]split[voriginal][vwfm],[vwfm]waveform=filter=lowpass:scale=digital:graticule=green:mirror=1:intensity=0.9:fitmode=size[vwfm],[voriginal][vwfm]vstack,scale=1920:1080[vid_right_border],[aid1][aid2][aid3][aid4][aid5][aid6][aid7][aid8][aid9][aid10][aid11][aid12][aid13][aid14][aid15][aid16]amerge=inputs=16[all],[all]pan=stereo|c0=c0|c1=c1[pc_audio],[pc_audio]asetpts=PTS-0.24/TB[ao],[vid_right_border]copy[withaudiobars],[withaudiobars]copy[vo]" c:\temp\xavc_Vistek_100_TRANSCODE_1stitched_4_1.mxf
@emcodem
emcodem / timebase.txt
Created April 10, 2024 09:51
ffconcat timebase experiments
ffmpeg -i "concat:v1.mp4|v2.mp4" -i "concat:a1.mp4|a2.mp4" -codec copy -map 0:v -map 1:a -video_track_timescale 25 out.mp4 -y
C:\temp\webinterface_1.4.0.5\tools\ffmpeg\ffprobe.exe -show_frames -select_streams v out.mp4 > out_frames.txt && C:\temp\webinterface_1.4.0.5\tools\ffmpeg\ffprobe -show_packets -select_streams v out.mp4 > out_packets.txt
working:
ffmpeg -i "concat:v1.mp4|v2.mp4" -i "concat:a1.mp4|a2.mp4" -codec copy -map 0:v -map 1:a -video_track_timescale 25 out.mp4 -y
loadplugin("C:\dev\FFAStrans\Processors\avs_plugins\ffms2\x64\ffms2.dll")
loadplugin("C:\AvsPmod\plugins\fmtconv.dll")
loadplugin("C:\AvsPmod\plugins\avsresize\x64\Release\avsresize.dll")
FFVideoSource("C:\temp\vistek.mxf") #vistek is a bt.709 colorbar
#check initial values in rgb 10 bit format
#z_ConvertFormat(pixel_type="rgbp10",colorspace_op="709:709:709:limited=>rgb:same:same:limited") #full-limited and to 10 bit
#return last
loadplugin("C:\dev\FFAStrans\Processors\avs_plugins\ffms2\x64\ffms2.dll")
loadplugin("C:\AvsPmod\plugins\fmtconv.dll")
loadplugin("C:\AvsPmod\plugins\avsresize\x64\Release\avsresize.dll")
FFVideoSource("c:\temp\rgb2111.nut") #rgb2111.nut is BT2111 bgrp10le colorbar hlg,2020,2020 (vapoursynth: c = core.colorbars.ColorBars(format=vs.RGB30, resolution=5, hdr=1))
##SCENE REFERRED
#
# BT.2111 seems to work with rgb source and target, we do the same here (avoid any yuv-rgb-yuv conversion)
#
@emcodem
emcodem / gist:764db05ef10c2ab4f20badc56f00aec1
Last active April 30, 2023 16:15
ffmpeg android commandline
install termux from app store
in termux:
termux-change-repo
* (choose main and bfsu)
apt-install openssl-tool
pkg install ffmpeg
test if ffmpeg works by typing ffmpeg, you should see default ffmpeg output
$ git diff libavcodec/cbs_h2645.c
diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c
index 80e48829af..30e213a289 100644
--- a/libavcodec/cbs_h2645.c
+++ b/libavcodec/cbs_h2645.c
@@ -726,7 +726,6 @@ static int cbs_h264_read_nal_unit(CodedBitstreamContext *ctx,
case H264_NAL_PPS:
{
H264RawPPS *pps = unit->content;
-
@emcodem
emcodem / launch.json
Created January 23, 2023 13:58
ffmpeg vscode launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/ffmpeg_g.exe",
"args": [
"-i",
"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" -I http "C:\temp\play\test_PCM_DolbyE_PCM_PCM.mxf" :sout=#transcode{vcodec=mp1v,vb=256k,vg=1,acodec=mp2,ab=128,channels=2}:{dst=std{access=file,mux=ts,dst="c:\\temp\\vlc.ts"}} --http-host 127.0.0.1 --http-port 1234 --http-password 1234
ffmpeg -re -i file.ext -f mp4 -movflags hls -c:v libx264 -listen 1 -seekable 0 -g 1 http://localhost:1935/live
<video src="http://localhost:1935/live" controls/>