I have a Betacam SP video tape of ABC News TV station from 1997, I captured it using the Sony J-3 via SDI to the hard drive in 8 bit lossless AVI (Sample here), I then de-interlaced with QTGMC prior to encoding to H.264, First tried the script bellow but it gave me an error:
Error:Code:ffmpeg -i In.avi scale=w=-1:h=-1:interl=1,format=yuv420p,setsar=sar=8/9" -flags +ildct+ilme -c:v libx264 -crf 10 -x264opts bff=1:colorprim=smpte170m:transfer=smpte170m:colormatrix=smpte170m:force-cfr -c:a aac -b:a 192k Out.mp4
Then tried a generic script which I'm not happy with:Code:ffmpeg version 4.1.1 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 8.2.1 (GCC) 20190212 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat 58. 20.100 / 58. 20.100 libavdevice 58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100 libpostproc 55. 3.100 / 55. 3.100 [avi @ 00000181d4628800] non-interleaved AVI Guessed Channel Layout for Input Stream #0.1 : stereo Input #0, avi, from 'ABCnews.avi': Duration: 00:03:03.12, start: 0.000000, bitrate: 138425 kb/s Stream #0:0: Video: huffyuv (HFYU / 0x55594648), yuv422p, 720x480, 136108 kb/s, 59.94 fps, 59.94 tbr, 59.94 tbn, 59.94 tbc Stream #0:1: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s32 (24 bit), 2304 kb/s scale=w=-1:h=-1:interl=1,format=yuv420p,setsar=sar=8/9 -flags +ildct+ilme -c:v libx264 -crf 10 -x264opts bff=1:colorprim=smpte170m:transfer=smpte170m:colormatrix=smpte170m:force-cfr -c:a aac -b:a 192k ABCnewsEnc.mp4: Invalid argument
---> Sample here.Code:ffmpeg -i In.avi -pix_fmt yuv420p -aspect 4:3 -b:a 192k Out.mp4
One last question, Does QTGMC works with 10bit captures?
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 13 of 13
Thread
-
-
I was able to get the script working by using the full commend from last year (credit goes to Poisondeathray):
Code:ffmpeg -i ABCnews.avi -vf "crop=w=720:h=480:x=0:y=0,scale=w=-1:h=-1:interl=1,format=yuv420p,setsar=sar=8/9" -flags +ildct+ilme -c:v libx264 -crf 10 -x264opts bff=1:colorprim=smpte170m:transfer=smpte170m:colormatrix=smpte170m:force-cfr -c:a aac -b:a 192k ABCnewsOut.mp4
Poisondeathray's enhanced script gives much better quality. The original file is 2.95GB, the sloppy script gave 29.2MB file and the enhanced script gave 260MB file, Take a look. -
Okay, I was making a mistake in the script, I think it should look like this:
Code:ffmpeg -i In.avi -vf "scale=w=-1:h=-1:interl=1,format=yuv420p,setsar=sar=8/9" -flags +ildct+ilme -c:v libx264 -crf 10 -x264opts bff=1:colorprim=smpte170m:transfer=smpte170m:colormatrix=smpte170m:force-cfr -c:a aac -b:a 192k Out.mp4
-
You can use avs input directly into ffmpeg (there is no need to use intermediate, but maybe you have other reasons)
After QTGMC, it's progressive now, you should encode progressive. There is no need for interlaced scaling now (you were scaling the chroma planes when going from 4:2:2 to 4:2:0, interl=1 signals ffmpeg to do that in an interlaced manner) . So discard interl=1 and the interlace flags, and bff=1
Are you wanting to encode 4:2:2 ? If so, format should be yuv422p , not yuv420p
eg. for 4:2:0 , change to yuv422p if you wanted 4:2:2
Code:ffmpeg -i In.avi -vf "format=yuv420p,setsar=sar=8/9"-c:v libx264 -crf 10 -x264opts colorprim=smpte170m:transfer=smpte170m:colormatrix=smpte170m:force-cfr -c:a aac -b:a 192k Out.mp4
-
Thanks Poinsdeathray, I would like to keep 4:2:2 depends on the compatibility of the playing end and the resulting files size, I will try both and see how it goes.
-
For whatever reason I'm getting this error:
[NULL @ 000002901f3a8f80] Unable to find a suitable output format for 'libx264'
libx264: Invalid argument -
There should be a space , after the end quotation mark
Code:ffmpeg -i In.avi -vf "format=yuv420p,setsar=sar=8/9" -c:v libx264 -crf 10 -x264opts colorprim=smpte170m:transfer=smpte170m:colormatrix=smpte170m:force-cfr -c:a aac -b:a 192k Out.mp4
-
Thanks, Besides the 4:2:2, is it a good idea to convert the original audio track from 24bit/48Khz to 16bit/48Khz instead of compressing it to 192kbps? Would 4:2:2 16bit/48Khz files be compatible with most smart devices and TV's?
-
192kbps is the bitrate ; 24bit is the the bit depth; 48Khz is the sampling rate . They can be independent parameters depending on which audio format. You used lossy AAC compression
Would 4:2:2 16bit/48Khz files be compatible with most smart devices and TV's? -
My question about audio was is it ok to use lossless PCM 16/48 instead of 192kbps 16/48, Sorry for the confusion. For video I must stick to 4:2:0 then.
-
uncompressed PCM should play on most AV equipment, but it's less compatible on portable devices . You have to try it out
-
-
-c:a pcm_s16le instead of -c:a aac
mkv container, or mov, or transport stream (ts, mts, m2ts) , because open source MP4 muxers do not support PCM
Code:ffmpeg -i In.avi -vf "format=yuv420p,setsar=sar=8/9" -c:v libx264 -crf 10 -x264opts colorprim=smpte170m:transfer=smpte170m:colormatrix=smpte170m:force-cfr -c:a pcm_s16le Out.mkv
Similar Threads
-
Does 2-Pass encoding with H.264 really not result in better quality?
By pxstein in forum Video ConversionReplies: 6Last Post: 22nd Apr 2020, 17:02 -
How to get correct PTS for B-Frames when encoding to AVC H.264 videos?
By pxstein in forum Newbie / General discussionsReplies: 0Last Post: 30th Jan 2019, 04:13 -
Simple process for interlaced H.264 encoding
By huykin in forum Video ConversionReplies: 25Last Post: 24th Jan 2017, 15:17 -
Many obscurities in encoding MPEG-2 to H.264 (newbie)
By draig-llofrudd in forum Newbie / General discussionsReplies: 3Last Post: 6th Dec 2016, 12:13 -
Encoding SD video with H.264 to be 100% Blu-ray compliant.
By PuzZLeR in forum User guidesReplies: 14Last Post: 19th Oct 2015, 18:12