VideoHelp Forum
+ Reply to Thread
Page 2 of 2
FirstFirst 1 2
Results 31 to 46 of 46
Thread
  1. Dinosaur Supervisor KarMa's Avatar
    Join Date
    Jul 2015
    Location
    US
    Search Comp PM
    Broadcasters don't have to follow those bitrates and tend to do whatever they think is best. For example one PBS station in my area does one 1080i channel with three 480p channels, and they even prioritize one 480p channel with more bitrate when compared with the other two. They are able to fit some much on one channel with VBR.
    Quote Quote  
  2. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    Originally Posted by chris319 View Post
    They are on the tip of the tongue of anyone who deals with television syndication.
    Why are you playing coy? Because you seem to be asking a question that you already know the answer to. Cornucopia is guessing the reason is that you want to act smug and smart. But Homer Simpson: "I am so smart, S-M-R-T." Or perhaps that you don't know at all, or "know of" them via reading Google, Wikipedia, whatever.

    You asked "I know what the standard is. The question is whether I need to be concerned with it when encoding video."
    And that question makes zero sense.
    Even if we assume you're asking about encoding for submission, the question still makes no sense.

    I'm usually much nicer about clueless questions being asked, and I do my best to educate the clueless person so that they're no longer clueless, and without telling them they're currently clueless. But you're being an ass. A clueless ass. And this isn't the first time you've been that way in VH threads. Most of which are also newbie-ish questions about ffmpeg, Youtube, colorspace, etc.

    I can't answer your coy question because I've been away from that level of broadcast for about 9 years now, and no longer remember, nor care. Plus the landscape probably changed again. So my info on broadcaster specs/etc may be a bit dated. However, it doesn't matter. Why? I'd usually encode uncompressed or lossless, using whatever is accepted from their spec sheet, and let them digitally ingest to their system. What they do doesn't matter on our end. You're not allowed to just randomly submit whatever you want or think they need. At most, ask if something like ProRes422 or an MXF wrapper is supported, things like that, but you can't just do it on your own accord. Some generous places may take something like 25-50mbps MPEG-2 422, but it's a stretch, as long GOP is not always friendly as source for their systems.

    I had a sub to Broadcast Engineering for many years, even after I moved to studio work, and still have tearsheets that talk about some of these topics very in depth. You won't find stuff like that from Googling, wikis, and whatnot.

    Originally Posted by KarMa View Post
    Broadcasters don't have to follow those bitrates and tend to do whatever they think is best. For example one PBS station in my area does one 1080i channel with three 480p channels, and they even prioritize one 480p channel with more bitrate when compared with the other two. They are able to fit some much on one channel with VBR.
    Yes. The station has the final word, not the affiliate or whoever.
    Last edited by lordsmurf; 24th Jul 2018 at 19:14.
    Want my help? Ask here! (not via PM!)
    FAQs: Best Blank DiscsBest TBCsBest VCRs for captureRestore VHS
    Quote Quote  
  3. Broadcasters don't have to follow those bitrates and tend to do whatever they think is best.
    As long as they don't go outside of their 6 MHz channel/exceed 19.4 Mbps, otherwise they risk guaranteed fines. Emissions outside the 6 MHz channel are a huge Bozo-no-no.

    If I'm not mistaken, that chart is based on MPEG-2. Now that H.264 is part of the ATSC spec it changes everything. Are any of the subchannels of that PBS affiliate doing H.264?
    Quote Quote  
  4. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    Originally Posted by chris319 View Post
    Now that H.264 is part of the ATSC spec it changes everything.
    It changes nothing. As far as I'm aware, everything is still MPEG-2. It may jump to HEVC, but even that is suspect for ATSC. Whereas DVB-T has been on HEVC for a while now, and is currently in mass adoption. I'm not sure what DSS is doing anymore, but probably still MPEG as well. USA broadcast wheels turn very slowly.

    And none of it matters unless you're actually in broadcast. It's just trivia for us.
    Want my help? Ask here! (not via PM!)
    FAQs: Best Blank DiscsBest TBCsBest VCRs for captureRestore VHS
    Quote Quote  
  5. Member
    Join Date
    Aug 2006
    Location
    United States
    Search Comp PM
    Originally Posted by chris319 View Post
    Now that H.264 is part of the ATSC spec it changes everything. Are any of the subchannels of that PBS affiliate doing H.264?
    PBS in my area has 1 primary and 4 sub-channels. I know for certain that all are MPEG-2. There are probably a great many TVs in the USA which couldn't decode an H.264 ATSC signal.

    I have only heard of one OTA TV provider in the USA that used an H.264 video signal, Airbox, a paid TV service associated with ION. Airbox operated in a few cities (Dallas, TX, Houston, TX, Phoenix, AZ, Jacksonville, FL, Memphis, TN) until they went out of business last year. Airbox used sub-channels provided by a local ION affiliate to deliver an encrypted H.264 ATSC signal. Subscribers needed to purchase a proprietary receiver to view/record the channels in their package.
    Last edited by usually_quiet; 25th Jul 2018 at 21:07.
    Ignore list: hello_hello, tried, TechLord, Snoopy329
    Quote Quote  
  6. Subscribers needed to purchase a proprietary receiver to view/record the channels in their package.
    Which may have contributed to their going out of business.

    There is an "if it ain't broke, don't fix it" mindset and I don't blame them. That probably explains why they haven't migrated to H.264. It's not worth the risk if home sets can't decode H.264.

    Here is some ffmpeg code which creates an mpeg2 .ts (transport stream) file which actually plays on VLC.

    Code:
    @rem video bit rate must be less than mux bit rate
    ffmpeg -y -i input  -pix_fmt yuv422p  -r 59.94  -s 1280x720  -vcodec mpeg2video -acodec ac3 -b:a 192K  -b:v 7.6M  -muxrate 7.8M -f mpegts output.ts
    Quote Quote  
  7. Originally Posted by chris319 View Post
    Here is some ffmpeg code which creates an mpeg2 .ts (transport stream) file which actually plays on VLC.

    Code:
    @rem video bit rate must be less than mux bit rate
    ffmpeg -y -i input  -pix_fmt yuv422p  -r 59.94  -s 1280x720  -vcodec mpeg2video -acodec ac3 -b:a 192K  -b:v 7.6M  -muxrate 7.8M -f mpegts output.ts
    Well... try this bellow for mpeg-2 and you should see way better results (tweek for desired level and profile and remaining options).

    https://forum.doom9.org/showthread.php?p=1809116#post1809116

    And multiplexing is straight forward:
    bellow my piece of code that works in real life environment (1 video ES, 3 audio ES) - please modify for ATSC and 8-VSB as it was created for DVB target - some other changes for ATSC are required - just follow https://ffmpeg.org/ffmpeg-formats.html#mpegts-1 and follow ATSC PSIP (Program and System Information Protocol) recommendations - there is substantial difference between DVB and ATSC PSIP philosophy.

    Code:
    @setlocal
    @rem --- TS params 8-VSB ---
    @set muxrate=19390.4k 
    @rem --- ---
    
    @set mpegts=-muxrate %muxrate% -mpegts_original_network_id 1 -mpegts_transport_stream_id 1 -mpegts_pmt_start_pid 64 -mpegts_service_id 1 -streamid 0:128 -streamid 1:129 -streamid 2:130 -streamid 3:131 -metadata service_provider="Hobby_TEST" -metadata service_name="8-VSB" -tables_version 1 -mpegts_service_type 0x19 -mpegts_flags -system_b+pat_pmt_at_frames+resend_headers+initial_discontinuity
    
    ffmpeg.exe (your commandline)  -f mpegts %mpegts% target (file or streaming to for example multiplexer over IP)
    Quote Quote  
  8. Too many errors:

    Code:
    rease qmax
    [mpeg2video @ 000002b39ed01540] rc buffer underflow00:09.05 bitrate=11111.9kbits/s speed=0.397x
    [mpeg2video @ 000002b39ed01540] max bitrate possibly too small or try trellis with large lmax or increase qmax
    [mpeg2video @ 000002b39ed01540] rc buffer underflow00:09.20 bitrate=11158.5kbits/s speed=0.395x
    [mpeg2video @ 000002b39ed01540] max bitrate possibly too small or try trellis with large lmax or increase qmax
    [mpeg2video @ 000002b39ed01540] rc buffer underflow00:09.32 bitrate=11243.6kbits/s speed=0.391x
    [mpeg2video @ 000002b39ed01540] max bitrate possibly too small or try trellis with large lmax or increase qmax
    [mpeg2video @ 000002b39ed01540] rc buffer underflow0:09.42 bitrate=11124.2kbits/s speed=0.387x
    [mpeg2video @ 000002b39ed01540] max bitrate possibly too small or try trellis with large lmax or increase qmax
    [mpeg2video @ 000002b39ed01540] rc buffer underflow00:09.57 bitrate=11168.8kbits/s speed=0.385x
    [mpeg2video @ 000002b39ed01540] max bitrate possibly too small or try trellis with large lmax or increase qmax
    [mpeg2video @ 000002b39ed01540] rc buffer underflow
    [mpeg2video @ 000002b39ed01540] max bitrate possibly too small or try trellis with large lmax or increase qmax
    [mpeg2video @ 000002b39ed01540] rc buffer underflow00:09.82 bitrate=11097.8kbits/s speed=0.379x
    [mpeg2video @ 000002b39ed01540] max bitrate possibly too small or try trellis with large lmax or increase qmax
    [mpeg2video @ 000002b39ed01540] rc buffer underflow0:09.90 bitrate=11216.0kbits/s speed=0.374x
    [mpeg2video @ 000002b39ed01540] max bitrate possibly too small or try trellis with large lmax or increase qmax
    [mpeg2video @ 000002b39ed01540] rc buffer underflow00:10.04 bitrate=11275.7kbits/s speed=0.371x
    [mpeg2video @ 000002b39ed01540] max bitrate possibly too small or try trellis with large lmax or increase qmax
    [mpeg2video @ 000002b39ed01540] rc buffer underflow00:10.14 bitrate=11164.4kbits/s speed=0.367x
    [mpeg2video @ 000002b39ed01540] max bitrate possibly too small or try trellis with large lmax or increase qmax
    [mpeg2video @ 000002b39ed01540] rc buffer underflow00:10.39 bitrate=11299.2kbits/s speed=0.363x
    [mpeg2video @ 000002b39ed01540] max bitrate possibly too small or try trellis with large lmax or increase qmax
    [mpeg2video @ 000002b39ed01540] rc buffer underflow00:10.51 bitrate=11173.6kbits/s speed=0.361x
    [mpeg2video @ 000002b39ed01540] max bitrate possibly too small or try trellis with large lmax or increase qmax
    [mpeg2video @ 000002b39ed01540] rc buffer underflow0:10.64 bitrate=11230.6kbits/s speed=0.359x
    [mpeg2video @ 000002b39ed01540] max bitrate possibly too small or try trellis with large lmax or increase qmax
    [mpeg2video @ 000002b39ed01540] rc buffer underflow00:10.89 bitrate=11165.1kbits/s speed=0.355x
    [mpeg2video @ 000002b39ed01540] max bitrate possibly too small or try trellis with large lmax or increase qmax
    [mpeg2video @ 000002b39ed01540] rc buffer underflow
    [mpeg2video @ 000002b39ed01540] max bitrate possibly too small or try trellis with large lmax or increase qmax
    [mpeg2video @ 000002b39ed01540] rc buffer underflow00:11.01 bitrate=11237.1kbits/s speed=0.352x
    [mpeg2video @ 000002b39ed01540] max bitrate possibly too small or try trellis with large lmax or increase qmax
    [mpeg2video @ 000002b39ed01540] rc buffer underflow00:11.11 bitrate=11324.6kbits/s speed=0.349x
    [mpeg2video @ 000002b39ed01540] max bitrate possibly too small or try trellis with large lmax or increase qmax
    [mpeg2video @ 000002b39ed01540] rc buffer underflow00:11.34 bitrate=11276.3kbits/s speed=0.345x
    [mpeg2video @ 000002b39ed01540] max bitrate possibly too small or try trellis with large lmax or increase qmax
    [mpeg2video @ 000002b39ed01540] rc buffer underflow
    [mpeg2video @ 000002b39ed01540] max bitrate possibly too small or try trellis with large lmax or increase qmax
    [mpeg2video @ 000002b39ed01540] rc buffer underflow00:11.57 bitrate=11230.0kbits/s speed=0.341x
    [mpeg2video @ 000002b39ed01540] max bitrate possibly too small or try trellis with large lmax or increase qmax
    [mpeg2video @ 000002b39ed01540] rc buffer underflow00:11.67 bitrate=11313.3kbits/s speed=0.339x
    [mpeg2video @ 000002b39ed01540] max bitrate possibly too small or try trellis with large lmax or increase qmax
    [mpeg2video @ 000002b39ed01540] rc buffer underflow00:11.91 bitrate=11267.5kbits/s speed=0.335x
    [mpeg2video @ 000002b39ed01540] max bitrate possibly too small or try trellis with large lmax or increase qmax
    [mpeg2video @ 000002b39ed01540] rc buffer underflow
    [mpeg2video @ 000002b39ed01540] max bitrate possibly too small or try trellis with large lmax or increase qmax
    frame=  720 fps= 20 q=18.0 Lsize=   16649kB time=00:00:11.99 bitrate=11369.9kbits/s speed=0.333x    
    video:16649kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
    ---------------------------------------------------------------
    Second pass ...
    ---------------------------------------------------------------
    ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers
      built with gcc 7.3.0 (GCC)
      configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --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. 14.100 / 56. 14.100
      libavcodec     58. 18.100 / 58. 18.100
      libavformat    58. 12.100 / 58. 12.100
      libavdevice    58.  3.100 / 58.  3.100
      libavfilter     7. 16.100 /  7. 16.100
      libswscale      5.  1.100 /  5.  1.100
      libswresample   3.  1.100 /  3.  1.100
      libpostproc    55.  1.100 / 55.  1.100
    Unrecognized option 'sc_factor'.
    Error splitting the argument list: Option not found
    Quote Quote  
  9. Why would I see "way better results" with that code?
    Quote Quote  
  10. Originally Posted by chris319 View Post
    Why would I see "way better results" with that code?
    There is "old" and "new" way to control mpeg2video encoder in ffmpeg - old way is classic bitrate definition where new one add some additional parameters that guide mpeg2video encoder toward higher quality encoding (generally old way gives poor quality results and new one very high quality in ffmpeg - similar or sometimes better than HCEnc which is quite reputable MPEG-2 free encoder).

    To avoid errors you may wish to change some parameters, also proper quantization matrices are very important, 2 pass encoding may be not best way to deal with broadcast target. Remember that Main Profile Main Level bitrate limit is 15Mbps. generally DVD settings are good starting point toward HQ MPEG-2.

    I use ffmpeg with modified settings for Mpeg-1 encoding (there are some differences between MPEG-1 and MPEG-2) and with very bizarre settings insanely low bitrates) i have quite nice results (with respect of bitrate)...

    Bellow example

    Code:
    @set intra="8,16,19,22,99,99,99,99,16,16,22,24,99,99,99,99,19,22,26,27,99,99,99,99,22,22,26,27,99,99,99,99,22,26,27,29,99,99,99,99,26,27,29,32,99,99,99,99,26,27,29,34,99,99,99,99,27,29,35,38,99,99,99,127"
    @set inter="16,17,18,19,99,99,99,99,17,18,19,20,99,99,99,99,18,19,20,21,99,99,99,99,19,20,21,22,99,99,99,99,20,21,22,23,99,99,99,99,21,22,23,24,99,99,99,99,22,23,24,26,99,99,99,99,23,24,25,27,99,99,99,127"
    
    
    @ffmpeg -hide_banner -y -color_range 2 -i "%1" -sn -dn -c:v mpeg1video -slices 4 -thread_type slice -profile:v 4 -level:v 8 -crf %qf% -maxrate %vmaxrate%k -g %gop% -bufsize:v %vbuffsiz%k -bf 0 -qcomp 0.7 -qblur 0 -qmin 4 -qmax 51 -dc 8 -lmin 0.75 -mblmin 50 -sc_threshold 1 -sc_factor 4 -me_method dia -dia_size -4 -pre_dia_size -4 -preme 5 -bidir_refine 4 -mbd rd -cmp satd -subcmp satd -mbcmp satd -precmp satd -skipcmp satd -intra_matrix %intra% -inter_matrix %inter% -vf %vproc% -color_range 2 -colorspace 8 -an -b:a %abitrate%k -vbr:a constrained -maxrate:a %amaxrate%k -af %aproc% -f matroska "%OUTDIR%\%~n1_ycgco_mpeg1.mkv"
    Those settings may looks strange but this very weird situation where video bitrate is around 200kbps and used color space is YCgCo (video+audio transfered with floppy interface speed SD MFM 250kbps).
    Quote Quote  
  11. I tried this code and MediaInfo reports "overall bit rate" of 5.37 Mbps. Am I doing it right?

    This is for ATSC terrestrial broadcast so we're locked into MPEG2. No one is yet using H.264 as noted above.

    Code:
    @setlocal
    
    @set muxrate=19390.4k
    
    @set mpegts=-muxrate %muxrate% -mpegts_original_network_id 1 -mpegts_transport_stream_id 1 -mpegts_pmt_start_pid 64 -mpegts_service_id 1  -metadata service_name="8-VSB" -tables_version 1 -mpegts_service_type 0x19 -mpegts_flags -system_b+pat_pmt_at_frames+resend_headers+initial_discontinuity
    
    bin\ffmpeg.exe -y -i "D:\Videos\Canon Vixia HF G40\35 Mbps.MP4"  -f mpegts %mpegts% target output.ts
    Quote Quote  
  12. Originally Posted by chris319 View Post
    I tried this code and MediaInfo reports "overall bit rate" of 5.37 Mbps. Am I doing it right?

    This is for ATSC terrestrial broadcast so we're locked into MPEG2. No one is yet using H.264 as noted above.

    Code:
    @setlocal
    
    @set muxrate=19390.4k
    
    @set mpegts=-muxrate %muxrate% -mpegts_original_network_id 1 -mpegts_transport_stream_id 1 -mpegts_pmt_start_pid 64 -mpegts_service_id 1  -metadata service_name="8-VSB" -tables_version 1 -mpegts_service_type 0x19 -mpegts_flags -system_b+pat_pmt_at_frames+resend_headers+initial_discontinuity
    
    bin\ffmpeg.exe -y -i "D:\Videos\Canon Vixia HF G40\35 Mbps.MP4"  -f mpegts %mpegts% target output.ts
    Your code didn't specified video and audio codec (with necessary settings) it is only muxer part responsible for creating transport stream... definitely you need combine all pieces together - sorry but this part of work you must do by yourself (target is just name for imaginary missing part of your commandline).

    Something like:
    Code:
    @setlocal
    @set FFMPG=D:\Media\FF
    @set PATH=%PATH%;%FFMPG%
    @set FC_CONFIG_DIR=%FFMPG%\conf
    @set FONTCONFIG_FILE=%FFMPG%\conf\fonts.conf
    @set FONTCONFIG_PATH=%FFMPG%\conf
    @set OUTDIR="out"
    @if not exist %cd%\%OUTDIR% (mkdir %cd%\%OUTDIR%)
    
    @set fps=25/1
    @set qf=4
    @set gop=50
    
    @rem disk bitrate
    @set dbitrate=249
    
    @rem audio bitrate
    @set abitrate=32
    @set amaxrate=%abitrate%*2
    
    @rem overhead
    @set overhd=3
    
    @rem videomaxrate
    @set /a vmaxrate=((%dbitrate%*(100-%overhd%))/100)-%abitrate%
    
    @set /a vbitrate=(%vmaxrate%*75)/100
    @rem set /a vbuffsiz=(%vmaxrate%*%gop%)/50
    @set vbuffsiz=%vmaxrate%
    
    @echo dbitrate=%dbitrate% ; abitrate=%abitrate% ; vmaxrate=%vmaxrate% ; vbitrate=%vbitrate% ; vbuffsiz=%vbuffsiz%
    
    @set intra="8,16,19,22,99,99,99,99,16,16,22,24,99,99,99,99,19,22,26,27,99,99,99,99,22,22,26,27,99,99,99,99,22,26,27,29,99,99,99,99,26,27,29,32,99,99,99,99,26,27,29,34,99,99,99,99,27,29,35,38,99,99,99,127"
    @set inter="16,17,18,19,99,99,99,99,17,18,19,20,99,99,99,99,18,19,20,21,99,99,99,99,19,20,21,22,99,99,99,99,20,21,22,23,99,99,99,99,21,22,23,24,99,99,99,99,22,23,24,26,99,99,99,99,23,24,25,27,99,99,99,127"
    
    @set samplerate=24000
    
    @rem possible audither are: ('none'?‘rectangular’‘triangular’‘triangular_hp’‘lipshitz’‘shibata’‘low_shibata’‘high_shibata’‘f_weighted’‘modified_e_weighted’‘improved_e_weighted’)
    @set audither=0
    
    
    @rem audio signal processing
    
    @set aproc="pan=stereo|FL < FL+1.414FC+0.5BL+0.5SL+0.25LFE+0.125BR|FR < FR+1.414FC+0.5BR+0.5SR+0.25LFE+0.125BL,firequalizer=gain='if(gte(f,20),0,-INF)+if(lte(f,10500),0,-INF)',dynaudnorm=p=1/sqrt(2):m=100:s=12,firequalizer=gain='if(gte(f,20),0,-INF)+if(lte(f,10500),0,-INF)',aresample=resampler=soxr:osr=%samplerate%:cutoff=0.990:dither_method=%audither%"
    
    @rem video signal processing
    
    @set vproc="eq=contrast=256/220:brightness=1/512:saturation=256/224:gamma=16/16,scale=640:-4:sws_flags=spline+accurate_rnd+full_chroma_int+full_chroma_inp:sws_dither=0:in_range=1:out_range=1,hqdn3d=8,tblend=all_mode=average,smartblur=lr=1.75:ls=-0.50:lt=-5.5:cr=0.5:cs=1.0:ct=0.5,minterpolate=fps=%fps%:mi_mode=mci:me_mode=bidir:me=ntss:vsbmc=1,xbr=2,scale=s=320x256:force_original_aspect_ratio=decrease:sws_flags=spline+accurate_rnd+full_chroma_int+full_chroma_inp:sws_dither=2:in_range=1:out_range=1,format=pix_fmts=yuv420p"
    
    @ffmpeg -hide_banner -y -color_range 2 -i "%1" -sn -dn -c:v mpeg1video -slices 4 -thread_type slice -profile:v 4 -level:v 8 -crf %qf% -maxrate %vmaxrate%k -g %gop% -bufsize:v %vbuffsiz%k -bf 0 -qcomp 0.7 -qblur 0 -qmin 4 -qmax 51 -dc 8 -lmin 0.75 -mblmin 50 -sc_threshold 1 -sc_factor 4 -me_method dia -dia_size -4 -pre_dia_size -4 -preme 5 -bidir_refine 4 -mbd rd -cmp satd -subcmp satd -mbcmp satd -precmp satd -skipcmp satd -intra_matrix %intra% -inter_matrix %inter% -vf %vproc% -color_range 2 -colorspace 8 -an -b:a %abitrate%k -vbr:a constrained -maxrate:a %amaxrate%k -af %aproc% -f matroska "%OUTDIR%\%~n1_ycgco_mpeg1.mkv"
    
    @endlocal
    @pause
    Last edited by pandy; 26th Jul 2018 at 13:22.
    Quote Quote  
  13. Like so? Now I am getting 19.4 Mbps.

    Code:
    @setlocal
    
    @set muxrate=19390.4k
    
    @set mpegts=-muxrate %muxrate% -mpegts_original_network_id 1 -mpegts_transport_stream_id 1 -mpegts_pmt_start_pid 64 -mpegts_service_id 1  -metadata service_name="8-VSB" -tables_version 1 -mpegts_service_type 0x19 -mpegts_flags -system_b+pat_pmt_at_frames+resend_headers+initial_discontinuity
    bin\ffmpeg.exe -y -i "D:\Videos\Canon Vixia HF G40\35 Mbps.MP4"  -pix_fmt yuv422p  -r 59.94  -s 1280x720  -vcodec mpeg2video -acodec ac3  -f mpegts %mpegts% output.ts
    Quote Quote  
  14. Sorry Pandy, your code gives this error:

    Unrecognized option 'sc_factor'.
    Error splitting the argument list: Option not found
    Code:
    @setlocal
    @set FFMPG=D:\Programs\ffmpeg\BroadcastVideo
    @set PATH=%PATH%;%FFMPG%
    @set FC_CONFIG_DIR=%FFMPG%\conf
    @set OUTDIR="out"
    @if not exist %cd%\%OUTDIR% (mkdir %cd%\%OUTDIR%)
    
    @set fps=25/1
    @set qf=4
    @set gop=50
    
    @rem disk bitrate
    @set dbitrate=249
    
    @rem audio bitrate
    @set abitrate=32
    @set amaxrate=%abitrate%*2
    
    @rem overhead
    @set overhd=3
    
    @rem videomaxrate
    @set /a vmaxrate=((%dbitrate%*(100-%overhd%))/100)-%abitrate%
    
    @set /a vbitrate=(%vmaxrate%*75)/100
    @rem set /a vbuffsiz=(%vmaxrate%*%gop%)/50
    @set vbuffsiz=%vmaxrate%
    
    @echo dbitrate=%dbitrate% ; abitrate=%abitrate% ; vmaxrate=%vmaxrate% ; vbitrate=%vbitrate% ; vbuffsiz=%vbuffsiz%
    
    @set intra="8,16,19,22,99,99,99,99,16,16,22,24,99,99,99,99,19,22,26,27,99,99,99,99,22,22,26,27,99,99,99,99,22,26,27,29,99,99,99,99,26,27,29,32,99,99,99,99,26,27,29,34,99,99,99,99,27,29,35,38,99,99,99,127"
    @set inter="16,17,18,19,99,99,99,99,17,18,19,20,99,99,99,99,18,19,20,21,99,99,99,99,19,20,21,22,99,99,99,99,20,21,22,23,99,99,99,99,21,22,23,24,99,99,99,99,22,23,24,26,99,99,99,99,23,24,25,27,99,99,99,127"
    
    @set samplerate=24000
    
    @rem possible audither are: ('none'?‘rectangular’‘triangular’‘triangular_hp’‘lipshitz’‘shibata’‘low_shibata’‘high_shibata’‘f_weighted’‘modified_e_weighted’‘improved_e_weighted’)
    @set audither=0
    
    
    @rem audio signal processing
    
    @set aproc="pan=stereo|FL < FL+1.414FC+0.5BL+0.5SL+0.25LFE+0.125BR|FR < FR+1.414FC+0.5BR+0.5SR+0.25LFE+0.125BL,firequalizer=gain='if(gte(f,20),0,-INF)+if(lte(f,10500),0,-INF)',dynaudnorm=p=1/sqrt(2):m=100:s=12,firequalizer=gain='if(gte(f,20),0,-INF)+if(lte(f,10500),0,-INF)',aresample=resampler=soxr:osr=%samplerate%:cutoff=0.990:dither_method=%audither%"
    
    @rem video signal processing
    
    @set vproc="eq=contrast=256/220:brightness=1/512:saturation=256/224:gamma=16/16,scale=640:-4:sws_flags=spline+accurate_rnd+full_chroma_int+full_chroma_inp:sws_dither=0:in_range=1:out_range=1,hqdn3d=8,tblend=all_mode=average,smartblur=lr=1.75:ls=-0.50:lt=-5.5:cr=0.5:cs=1.0:ct=0.5,minterpolate=fps=%fps%:mi_mode=mci:me_mode=bidir:me=ntss:vsbmc=1,xbr=2,scale=s=320x256:force_original_aspect_ratio=decrease:sws_flags=spline+accurate_rnd+full_chroma_int+full_chroma_inp:sws_dither=2:in_range=1:out_range=1,format=pix_fmts=yuv420p"
    
    @ffmpeg -hide_banner -y -color_range 2 -i "%1" -sn -dn -c:v mpeg1video -slices 4 -thread_type slice -profile:v 4 -level:v 8 -crf %qf% -maxrate %vmaxrate%k -g %gop% -bufsize:v %vbuffsiz%k -bf 0 -qcomp 0.7 -qblur 0 -qmin 4 -qmax 51 -dc 8 -lmin 0.75 -mblmin 50 -sc_threshold 1 -sc_factor 4 -me_method dia -dia_size -4 -pre_dia_size -4 -preme 5 -bidir_refine 4 -mbd rd -cmp satd -subcmp satd -mbcmp satd -precmp satd -skipcmp satd -intra_matrix %intra% -inter_matrix %inter% -vf %vproc% -color_range 2 -colorspace 8 -an -b:a %abitrate%k -vbr:a constrained -maxrate:a %amaxrate%k -af %aproc% -f matroska "%OUTDIR%\%~n1_ycgco_mpeg1.mkv"
    
    @endlocal
    @pause
    Quote Quote  
  15. Originally Posted by chris319 View Post
    Sorry Pandy, your code gives this error:

    Unrecognized option 'sc_factor'.
    Error splitting the argument list: Option not found
    https://trac.ffmpeg.org/ticket/7228

    You need to remove sc_factor (also you may wish to tweak sc treshold) - seem it was removed from ffmpeg some while ago (since 3 rev) - script was created 2 years ago - this shows why ffmpeg can be pain in the ass - they frequently changing a lot of things and changes are frequently undocumented or poorly documented - script working with older ffmpeg may not work with newer...
    Quote Quote  



Similar Threads

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