i'm using zeranoe FFmpeg Build Version: 2a8dadb (2016-07-01)
my script : ffmpeg -i c:\AVerRecord170702a.avi -vcodec libx264 -preset veryslow -b:v 6000k -maxrate 6000k -bufsize 145000k -profile:v high -level 4.1 -an AVerRecord170702b.mp4
i'm getting this below error when i try to convert avi to mp4
where am i going wrong? please help.
+ Reply to Thread
Results 1 to 25 of 25
-
-
Your source is 4:2:2.
High Profile doesn't support 4:2:2 encoding, only the "regular" 4:2:0 subsampling
If you want to encode 4:2:2 , use high422 (ie. "-profile:v high422")
Or convert it to 4:2:0 (e.g. -pix_fmt yuv420p) , but if you have interlaced material it needs to use interlace scaling, and you should be using interlaced encoding -
You have to decide . It depends on the background information, why you are doing this, what scenario, what target(s) etc...
Either encode interlaced, or the other option is bob deinterlace it to 50p e.g use yadif or something
To encode interlaced in ffmpeg libx264 ,add -flags +ildct+ilme -x264opts tff=1
(I'm assuming it's TFF, 99.99% of HD video should be TFF if interlaced) -
add also interlaced=1 to x264 options line, side to this you may think on converting 4:2:2 to 4:2:0 if your goal is consumer players compatibility.
If source is not interlaced but should be encoded as interlaced you can guide x264 to use false (fake) interlace.
It will be easier to advise if you can share some sample and describe your goal (for example what kind of player will be used to play such video). -
i used this script:
ffmpeg -i C:\AVerRecord172629.avi -pix_fmt yuv420p -bf 3 -c:v libx264 -preset veryslow -b:v 6000k -maxrate 14000k -bufsize 14500k -profile:v high -level 4.1 -flags +ildct+ilme -x264opts tff=1 -qmin 4 -subq 9 -me_method hex -an AVerRecord172629a.mp4
i'm having dropping of frames -
Clarify what you mean by this ?
It doesn't report any dropped frames and the time is basically the same. 1:03.44 vs. 01:03.36. The difference is probably the timebase calculation
You also need to use interlaced scaling because the U,V planes are resized wihen you go from 4:2:2 to 4:2:0 and are keeping interlace. Otherwise you'll get chroma "ghosting"
Code:-vf scale=w=-1:h=-1:interl=1
-
sorry, i mean the video is jerking/flicking when I play in mpc-h
first i used this script
ffmpeg -i c:\AVerRecord170702a.avi -pix_fmt yuv420p -codec:v libx264 -preset veryslow -profile:v high -level 4.1 -b:v 6000k -maxrate 14000k -bufsize 14500k -bf 3 -flags +ildct+ilme -x264opts tff=1 -subq 9 -vf scale=w=-1:h=-1:interl=1 -an m:\AVerRecord170702b.mp4
and I used this
ffmpeg -i c:\AVerRecord170702a.avi -pix_fmt yuv420p -codec:v libx264 -preset veryslow -profile:v high -level 4.1 -b:v 6000k -maxrate 14000k -bufsize 14500k -bf 3 -flags +ildct+ilme -x264opts tff=1 -me_method umh -me_range 24 -subq 9 -vf scale=w=-1:h=-1:interl=1 -an m:\AVerRecord170702b.mp4
both was jerking.Last edited by yukukuhi; 3rd Jul 2016 at 04:35.
-
If it's interlaced, you have to activate a deinterlacer on playback. If it's jerking fwd/back, then that suggests wrong field order (bottom field first, instead of top field first)
It's a YUY2 uncompressed capture of something? of What ? Is it possible you have dropped frames in the capture ?
Post a sample of the source with steady motion, but zip it up (archive it with zip or rar) . You can cut a sample with vdub, in direct stream copy mode. Also post a sample if the encode. You can copy a section to cut with avidemux (in copy mode) -
Why you refuse to answer simple questions like what is target player, what kind of source you have?
It will be highly practical to knows answer for those question before advising you something to solve your problem - currently this is waste of time as obviously something not work and your source is not common as it use 4:2:2 - as such it may be anything even incorrect capture (wrong field order etc).
Provide sample - 5 - 10 seconds will be enough and information what kind of player you wish to use to play (if consumer not PC then it may not support anything above 4:2:0). -
hi poisondeathray can i send the video through cloud link
hi pandy i'm recording interlaced footage with tuner box, i want it to play both on pc and bluray players. -
Is your source is SD? If yes then best option is deinterlace source and upscaling it to 720p then encoding as progressive with doubled number of frames.
You need to set encoder for bluedisk compatibility (some limitations in h.264 syntax are mandatory for BD compatibility), at the same time color matrix mst be changed from 601 to 709.
I assume your source is 4:2:0 so no significant loss when going back to 4:2:0 from 4:2:2.
To confirm all this some small sample of the video will be nice to have. Use VirtualDub and select part with lot of motion - relatively short to avoid large file size, you may use lossless codec (huffyouv, ffv1) to further reduce file size.
Btw unless you really need particular bitrate it is better to use crf mode instead bitrate especially with such weird constrains.
You max bitrate shall be maximum defined by profile and level unless you use some media that impose bitrate limitations (network, radio transmission etc). -
my source is Hd,
i attached the video like you said i used utvideo lossless codec and
also here is the media info of the raw file
General
Complete name : C:\Users\Gankum\Videos\ AVerRecord170702ab.avi
Format : AVI
Format/Info : Audio Video Interleave
File size : 1.31 GiB
Duration : 13 s 560 ms
Overall bit rate : 831 Mb/s
Video
ID : 0
Format : YUV
Codec ID : YUY2
Codec ID/Info : YUV 4:2:2 as for UYVY but with different component ordering within the u_int32 macropixel
Duration : 13 s 560 ms
Bit rate : 829 Mb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 25.000 FPS
Color space : YUV
Chroma subsampling : 4:2:2
Compression mode : Lossless
Bits/(Pixel*Frame) : 16.000
Stream size : 1.31 GiB (100%)Last edited by yukukuhi; 5th Jul 2016 at 00:31.
-
I didn't see anything wrong with the source that would cause "jerking". Source content is progressive, not interlaced, if you've encoded it correctly with utvideo (maybe some other things were inadvertently done in between, that's why I asked for the original YUY2 source zipped up)
You didn't include an encoded version.
Are you using the word "jerking" correctly? Can you describe it in different words, maybe there is a miscommunication ?
You said it's "jerking" in mpchc. Can you try another player eg. potplayer, smplayer, vlc etc.. how does it play there ? -
This one should work OK - quality (and overall bitrate) is set trough crf value - 18 should be OK for most of situations:
Code:@SET x264opts="crf=18:vbv_maxrate=20000:vbv_bufsize=20000:level=4.0:keyint=250:qpmin=4:cabac=1:threads=auto:sliced_threads=0:slices=-1:tff=1:interlaced=0:fake-interlaced=1:no_psnr=1:no_ssim=1:bluray_compat=1:open-gop=0:pic_struct=1:aud=1:nal_hrd=vbr:force_cfr=1:fullrange=off:overscan=show:colorprim=bt709:transfer=bt709:colormatrix=bt709" @ffmpeg.exe -y -hide_banner -loglevel 32 -stats -color_range 2 -i "%1" -c:v libx264 -preset veryslow -tune film -profile:v high -level:v 4.0 -x264opts %x264opts% -x264-params %x264opts% -color_range 2 -vf "scale=iw:ih:sws_flags=neighbor:sws_dither=none:in_range=1:out_range=1,format=pix_fmts=yuv420p" -an -sn -movflags faststart -y -f mp4 "%~n1_vmo.mp4"
-
Copy those 2 lines to notepad and save with name you like, extension should be cmd or bat - that's all (drag and drop video file on it), this is only for video so i assume you processing audio in a different way.
--
Maybe those 3 lines will be better - set limited to local instance:
Code:@setlocal @set x264opts="crf=18:vbv_maxrate=20000:vbv_bufsize=20000:level=4.0:keyint=250:qpmin=4:cabac=1:threads=auto:sliced_threads=0:slices=-1:tff=1:interlaced=0:fake-interlaced=1:no_psnr=1:no_ssim=1:bluray_compat=1:open-gop=0:pic_struct=1:aud=1:nal_hrd=vbr:force_cfr=1:fullrange=off:overscan=show:colorprim=bt709:transfer=bt709:colormatrix=bt709" @ffmpeg.exe -y -hide_banner -loglevel 32 -stats -color_range 2 -i "%1" -c:v libx264 -preset veryslow -tune film -profile:v high -level:v 4.0 -x264opts %x264opts% -x264-params %x264opts% -color_range 2 -vf "scale=iw:ih:sws_flags=neighbor:sws_dither=none:in_range=1:out_range=1,format=pix_fmts=yuv420p" -an -sn -movflags faststart -y -f mp4 "%~n1_vmo.mp4"
Last edited by pandy; 5th Jul 2016 at 13:04.
-
Not sure if this help you but
Code:-b:v 6000k -maxrate 6000k -bufsize 145000k -profile:v high -level 4.1
-b:v 6000k set video bitrate 6Mbps this is OK but not optimal as unless need to do transmission over limited bandwidth (or use limited storage) more important is video quality as such i proposed crf instead bitrate.
-maxrate 6000k same as above but even more suboptimal - unless you transmission bandwidth or unique storage bandwidth limitation max bitrate shall be limited only by profile itself.
-bufsize 145000k is IMHO not in-line with HW limitations in most of HW players - generally there is recommendation that buffer size should be somewhere around 1 sec to perhaps maximum equal gop length in seconds (so gop in frames / by framerate)
-level 4.1 i usually limit level to 4.0 - some older HW may have problems with 4.1 -
Code:
tff=1:interlaced=0:fake-interlaced=1:bluray_compat=1
Enable interlaced mode (top field first)
fake-interlaced=1Flag stream as interlaced but encode progressive. Makes it possible to encode 25p and 30p Blu-Ray streams. Ignored in interlaced mode.Enable compatibility hacks for Blu-ray support -
lastly could you explain these commands please, it would be a great help of you in my learning, and thank you very much.
-vf "scale=iw:ih: sws_flags=neighbour:sws_dither=none:in_range=1:out _range=1
-movflags faststart -y -f mp4 "%~n1_vmo.mp4"
no_psnr=1:no_ssim=1:bluray_compat=1:open-gop=0:pic_struct=1:aud=1:nal_hrd=vbr:force_cfr=1:f ullrange=off:overscan=show:
-y -hide_banner -loglevel 32 -stats -color_range 2Last edited by yukukuhi; 8th Jul 2016 at 11:06.
-
no problemo
this force ffmpeg to keep fullscale video at the input and at the output - ffmpeg can be tricky and it is not easy to keep level untouched so this is a bit overkill but it works nicely.
flag movstart is recommended by YouTubeRun a second pass moving the index (moov atom) to the beginning of the file. This operation can take a while, and will not work in various situations such as fragmented output, thus it is not enabled by default.
%~n1_vmo.mp4 create new file with name of input file with added _vmo so if input file is for example xxx.avi output file will be xxx_vmo.mp4
i disable PSNR and SSIM calculation in x264 - not interested in those numbers at all, forcing bluray compatibility, closed gop, http://www.chaneru.com/Roku/HLS/X264_Settings.htm#pic-struct , http://www.chaneru.com/Roku/HLS/X264_Settings.htm#aud , http://www.chaneru.com/Roku/HLS/X264_Settings.htm#nal-hrd , http://www.chaneru.com/Roku/HLS/X264_Settings.htm#force-cfr , fullrange off means that video has limited quantization range (good h.264 decoder will use this information) , overscan=show - check this one - generally it guide decoder to display full video with overscan.
All those options are usually good for all kind of HW decoders and they usually not hurt quality/compressibility so why not.Last edited by pandy; 9th Jul 2016 at 06:24.
Similar Threads
-
Help - Creating a QWinFF XviD 2-Pass FFmpeg profile?
By thermalzombie in forum Video ConversionReplies: 2Last Post: 21st Feb 2016, 04:48 -
ffmpeg: setting IDR frames option.
By Prathamesh in forum Video ConversionReplies: 10Last Post: 12th Nov 2015, 14:22 -
FFMpeg : Use the "volume" filter for Preamp Equalizer setting ?
By alexander121 in forum AudioReplies: 0Last Post: 25th Jul 2015, 07:38 -
ffmpeg setting to convert AVCHD to HDV (mpeg2video)
By reko in forum Video ConversionReplies: 15Last Post: 8th Sep 2014, 10:03 -
FFmpeg Runtime error / FFmpeg git-df82454 32-bit Static (2012-10-03)
By MashedPotatoes in forum Newbie / General discussionsReplies: 5Last Post: 6th Oct 2012, 17:22