Need recommendation on Video Conversion

Questions involving a Windows version of FFmpeg.
Post Reply
Satheesh
Posts: 3
Joined: Fri Jun 28, 2019 1:43 pm

Need recommendation on Video Conversion

Post by Satheesh » Fri Jun 28, 2019 2:13 pm

Hi Folks,

I am new to FFmpeg and novice in video conversion tasks.

I had a Sony Handycam which records video in MPG format. Refer this link https://www.cnet.com/products/sony-handycam-dcr-sr60/ for specifications of the format.

I had accumulated 200 GB of video files so far and decided to take it to cloud. I had chosen Onedrive for the same but Onedrive supports only these formats 3G2, 3GP, ASF, BMP, M2TS, M4V, MOV, MP3, MP4, MP4V, MTS, TS, WMV. More details in https://support.office.com/en-us/articl ... bed77196a .

I need help to convert my MPG files to any of the above formats where quality is my utmost concern. I'm not concerned about the file size, even if it increases than the Original but need a high-quality video and audio.

Please help me on the same.

/Satheesh

pandy
Posts: 200
Joined: Mon Feb 24, 2014 1:46 pm

Re: Need recommendation on Video Conversion

Post by pandy » Mon Jul 01, 2019 7:08 pm

Use MP4 container with video codec H.264 and if possible keep original AC-3 audio track audio, for H.264 use CFR type encoding with sufficiently low CFR (lower = higher quality) - i would say something like CFR=12...16.

Satheesh
Posts: 3
Joined: Fri Jun 28, 2019 1:43 pm

Re: Need recommendation on Video Conversion

Post by Satheesh » Tue Jul 02, 2019 4:30 am

Many thanks for the response Pandy. After a few iterations, I am with the below command,

Code: Select all

ffmpeg -i input.MPG -vf yadif -c:v libx264 -preset veryslow -crf 10 -c:a aac -b:a 256k output.mp4
Please let me know about any improvements.

pandy
Posts: 200
Joined: Mon Feb 24, 2014 1:46 pm

Re: Need recommendation on Video Conversion

Post by pandy » Tue Jul 02, 2019 6:46 pm

Personally i would not use preset higher than medium, if my source is interlace i would stay with interlace, yadif is fast but not the best deinterlacer and there is no such thing as perfect deinterlacer, i would avoid to re-encode audio and stay with ac3

hydra3333
Posts: 198
Joined: Sun Apr 28, 2013 1:03 pm
Contact:

Re: Need recommendation on Video Conversion

Post by hydra3333 » Wed Jul 03, 2019 9:27 am

pandy wrote:
Tue Jul 02, 2019 6:46 pm
yadif is fast but not the best deinterlacer and there is no such thing as perfect deinterlacer
I would value your recommendation on which deinterlacer is better.

I gather there's a cuda deinterlacer which would be extremely fast but guess it's not better.

Satheesh
Posts: 3
Joined: Fri Jun 28, 2019 1:43 pm

Re: Need recommendation on Video Conversion

Post by Satheesh » Wed Jul 03, 2019 10:31 am

Thanks Pandy. I had started to see horizontal lines after conversion. Few websites provided me suggestion to use yadif and it addressed the problem to 85%. Still, I see those lines in motion but much better than earlier. If you can suggest any other deinterlacer, I will test and let you know.

Will change the Audio Codec to ac3 and preset to Medium. But without yadif, quality is very bad.

pandy
Posts: 200
Joined: Mon Feb 24, 2014 1:46 pm

Re: Need recommendation on Video Conversion

Post by pandy » Wed Jul 03, 2019 5:34 pm

You need tell ffmpeg libx264 that your source is interlaced - bit old but still useful:
https://forum.doom9.org/showthread.php?t=161531
https://superuser.com/questions/1344442 ... -264-video

Best "amateur" deinterlacer use Avistynth - search for famous QTGMC http://avisynth.nl/index.php/QTGMC

As there is no perfect deinterlacer then lot of people complain that deinterlacing is lossy processing - this is not true - deinterlacer trying to guess information lost in interlacing process - some deinterlacer are just better in guessing.

navilor
Posts: 51
Joined: Thu May 12, 2011 5:19 pm

Re: Need recommendation on Video Conversion

Post by navilor » Fri Jul 05, 2019 2:50 am

I have been in the streaming media industry since 2008. I am well versed in the usage of FFmpeg so much so that I felt compelled to write an article to debunk bad information regarding how to use FFmpeg to create streaming media compliant video. That article can be found at the link below.

https://videoblerg.wordpress.com/2017/1 ... -it-wrong/

pandy
Posts: 200
Joined: Mon Feb 24, 2014 1:46 pm

Re: Need recommendation on Video Conversion

Post by pandy » Fri Jul 05, 2019 9:23 pm

navilor wrote:
Fri Jul 05, 2019 2:50 am
I have been in the streaming media industry since 2008. I am well versed in the usage of FFmpeg so much so that I felt compelled to write an article to debunk bad information regarding how to use FFmpeg to create streaming media compliant video. That article can be found at the link below.

https://videoblerg.wordpress.com/2017/1 ... -it-wrong/
Strangely you are not using private libx264 options and ffmpeg is known to support only subset options normally available trough private libx264 option - for example:

Code: Select all

@SET x264opts="crf=%vq%:level=4.1:qpmin=8:cabac=1:keyint=infinite:no-deblock=1:no-mbtree=1:me=dia:rc-lookahead=5:ref=3:subme=0:no-weightb=1:weightp=0:trellis=0:no-scenecut=1:no_psnr=1:no_ssim=1:fullrange=on:overscan=show:colorprim=bt709:transfer=bt709:colormatrix=bt709"
keyint=infinite is used for special case of h.264 encoding within x264 encoder - encoding video with static picture i.e. video doesn't change. For regular video source it may even worsen quality forcing encoder to use suboptimal information.
Shorten GOP improve trick modes (random access over video) also adding RAP may improve video accessibility.
Also should have proper SEI and VUI and level - this is important for best video playout not only on PC but also on HW players.

However seem that OP need solution to archive (long term store) own videos not streaming settings.

Post Reply
'