VideoHelp Forum
+ Reply to Thread
Results 1 to 18 of 18
Thread
  1. Deleted
    Last edited by Rajesh Singh; 10th Mar 2019 at 03:45.
    Quote Quote  
  2. Code:
    for %%a in (*.mov) do ffmpeg -i "%%~a" -c:v libx264 -profile:v high422 -level 4.1 -pix_fmt yuv422p -preset veryslow -crf 14 -g 24 -vf setsar=sar=1/1 -threads 8 -x264-params bluray-compat=1:vbv-bufsize=20000:vbv-maxrate=40000 -strict -2 -c:a dca -b:a 1536k "output_folder\%%~na.m2ts"
    Originally Posted by Rajesh Singh View Post
    But the problem is that the third ffmpeg command in the pipelined cmd is NOT executing.
    Always post the complete ffmpeg log if you have problems.


    P.S.: Why do you encode like this with 4:2:2 video, bluray-compat=1 and "-level 4.1"?
    - 4:2:2 video is never Blu-Ray compatible
    - this video will be wrongly flagged level 4.1 while in reality far exceeding it (too many reference frames). Add ref=4 to x264 params for 1080p video and level 4.1

    Why encode 1536 kbps PCM to 1536 kbps DTS? Only result is quality loss.
    Last edited by sneaker; 9th Mar 2019 at 05:13.
    Quote Quote  
  3. Deleted
    Last edited by Rajesh Singh; 10th Mar 2019 at 03:46.
    Quote Quote  
  4. Deleted
    Last edited by Rajesh Singh; 10th Mar 2019 at 03:46.
    Quote Quote  
  5. Eh, too confusing.
    But the big problem I see is that your 1st and 2nd command output to files but your third expects some pipe input. Doesn't work like that.


    Either way it's too complicated. Just put everything into a single command like I posted in my earlier post. No need to split it into 3 steps.
    Quote Quote  
  6. Deleted
    Last edited by Rajesh Singh; 10th Mar 2019 at 03:47.
    Quote Quote  
  7. Deleted
    Last edited by Rajesh Singh; 10th Mar 2019 at 03:47.
    Quote Quote  
  8. Sorry, I forgot ffmpeg still isn't able to put PCM into m2ts. So if you want PCM in m2ts you have to separate into several steps and use a different muxer (e.g. tsMuxer). Otherwise I'd probably just use -c:a ac3 for m2ts output.
    Quote Quote  
  9. Originally Posted by Rajesh Singh View Post
    @sneaker bro, getting this error :
    C:\Users\Thakur Rajesh Singh>for %%a in (*.mov) do "C:\Users\Thakur Rajesh Singh\Downloads\Compressed\ffmpeg-4.1.1-win64-static\bin\ffmpeg.exe" -i "%%~a" -c:v libx264 -profile:v high422 -level 4.1 -pix_fmt yuv422p -preset veryslow -crf 14 -g 24 -vf setsar=sar=1/1 -threads 8 -x264-params :vbv-bufsize=20000:vbv-maxrate=40000 -c:a copy "C:\Users\Thakur Rajesh Singh\Downloads\%%~na.m2ts"
    %%a was unexpected at this time.
    Are you running straight from the command-prompt? Then use only single "%" instead of double "%%". Double "%%" is only for batch files.
    Quote Quote  
  10. Deleted
    Last edited by Rajesh Singh; 10th Mar 2019 at 03:47.
    Quote Quote  
  11. yes, BD is consumer format and it doesn't support anything than 420

    You can try something like bellow it should be close enough to your needs, not tested, there are two ffmpeg instances - remove or comment one of them, test it first at small batch of files (one or two - just copy to separate folder)

    Not sure if -c:a s302m is supported by m2ts so always you can fall-back to mkv and later try to remux it with different muxer as suggested by sneaker
    Seem your video source has wrong framerate (29970/1000) and it is interlaced (as such you need to encode it interlace mode)

    Code:
    @SET x264opts="crf=14:level=4.1:qpmin=4:vbv_maxrate=40000:vbv_bufsize=20000:cabac=1:interlaced=1:tff=1:no_psnr=1:no_ssim=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:stitchable=1"
    
    @FOR %%a IN (*.mov) DO (@ffmpeg.exe -hide_banner -v quiet -stats -y -i "%%a" -c:v libx264 -preset medium -tune film -profile:v high422 -level:v 4.1 -x264opts %x264opts% -x264-params %x264opts% -c:a s302m -f mpegts -mpegts_m2ts_mode 1 "%%~na.m2ts")
    
    @FOR %%a IN (*.mov) DO (@ffmpeg.exe -hide_banner -v quiet -stats -y -i "%%a" -c:v libx264 -preset medium -tune film -profile:v high422 -level:v 4.1 -x264opts %x264opts% -x264-params %x264opts% -c:a pcm_s16be -f matroska "%%~na.mkv")
    Quote Quote  
  12. Deleted
    Last edited by Rajesh Singh; 10th Mar 2019 at 03:48.
    Quote Quote  
  13. Originally Posted by Rajesh Singh View Post
    Thanks to @sneaker and @pandy for their generous help and advice. I have put the script in execution (albeit in preset=veryslow) and will revert to you once the first file is processed out.
    You should check how preset affect quality vs bitrate vs encoding speed in x264 - unless you are dealing with very low bitrates i see no added value from presets above medium. This is my private opinion and other may disagree with this.
    IMHO you also address faulty (non standard) framerate as it may trig some compatibility issues in future.
    Quote Quote  
  14. This one is interlaced, TFF , at least according to mediainfo. But you are encoding progressive

    Chroma subsampling : 4:2:2
    Scan type : Interlaced
    Scan type, store method : Interleaved fields
    Scan order : Top Field First
    Sometimes the content can be progressive, but encoded interlaced - you need to check and encode it properly. There is no way to verify the actual content automatically with any accuracy , except with your eyes
    Quote Quote  
  15. Deleted
    Last edited by Rajesh Singh; 10th Mar 2019 at 03:48.
    Quote Quote  
  16. The ones that are 23.976 progressive you can usually encode as progressive.

    The other one might be truly interlaced content, might be progressive content, but telecined (23.976p in 29.97i), might be field blended . You might have to do other operations . If it's progressive, the ideal thing to do is to recover the original progressive frames. If it's truly interlaced, you should encode interlaced (MBAFF for x264)

    mediainfo does not tell you with any accuracy about the actual content. It only tells you how it was encoded or flagged
    Quote Quote  
  17. Deleted
    Last edited by Rajesh Singh; 10th Mar 2019 at 03:48.
    Quote Quote  
  18. mr. Eric-jan's Avatar
    Join Date
    Apr 2018
    Location
    Netherlands
    Search Comp PM
    Strange content to have in ProRes, and even at HQ for FullHD i guess most BluRay authoring software doesn't support .MOV is this content captured on BlackmagicDesign hardware ? or straight from a camera ?
    Since you have 200 files, an hardware encoding solution would be a better solution.
    Quote Quote  



Similar Threads

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