VideoHelp Forum
+ Reply to Thread
Results 1 to 13 of 13
Thread
  1. Capturing Memories dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Member Since 2005, Re-joined in 2016
    Search PM
    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:

    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
    Error:
    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
    Then tried a generic script which I'm not happy with:

    Code:
    ffmpeg -i In.avi -pix_fmt yuv420p -aspect 4:3 -b:a 192k Out.mp4
    ---> Sample here.

    One last question, Does QTGMC works with 10bit captures?
    Image Attached Files
    Quote Quote  
  2. Capturing Memories dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Member Since 2005, Re-joined in 2016
    Search PM
    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
    I crop the extra 6 lines from the total 486 using VDub to have a visual look at the frame edges. I was trying to get rid of the cropping script in the above commend but failed, Now I use the full commend since nothing to crop anyway, the resolution is already 720x480.

    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.
    Image Attached Files
    Quote Quote  
  3. Capturing Memories dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Member Since 2005, Re-joined in 2016
    Search PM
    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
    Quote Quote  
  4. 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
    Quote Quote  
  5. Capturing Memories dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Member Since 2005, Re-joined in 2016
    Search PM
    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.
    Quote Quote  
  6. Capturing Memories dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Member Since 2005, Re-joined in 2016
    Search PM
    For whatever reason I'm getting this error:

    [NULL @ 000002901f3a8f80] Unable to find a suitable output format for 'libx264'
    libx264: Invalid argument
    Quote Quote  
  7. 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
    Quote Quote  
  8. Capturing Memories dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Member Since 2005, Re-joined in 2016
    Search PM
    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?
    Quote Quote  
  9. Originally Posted by dellsam34 View Post
    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?
    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?
    4:2:2 usually not compatible for most ; but 16bit/48Khz usually is for AAC audio (and other lossy audio formats like AC3, MP3 etc...)
    Quote Quote  
  10. Capturing Memories dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Member Since 2005, Re-joined in 2016
    Search PM
    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.
    Quote Quote  
  11. uncompressed PCM should play on most AV equipment, but it's less compatible on portable devices . You have to try it out
    Quote Quote  
  12. Capturing Memories dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Member Since 2005, Re-joined in 2016
    Search PM
    Originally Posted by poisondeathray View Post
    uncompressed PCM should play on most AV equipment, but it's less compatible on portable devices . You have to try it out
    How do I implement that in the script? note that the original files are lossless 24/48 so I have to down convert to 16/48.
    Quote Quote  
  13. Originally Posted by dellsam34 View Post
    Originally Posted by poisondeathray View Post
    uncompressed PCM should play on most AV equipment, but it's less compatible on portable devices . You have to try it out
    How do I implement that in the script? note that the original files are lossless 24/48 so I have to down convert to 16/48.
    -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
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!