[FFmpeg-user] Proper way to reverse PAL Speed up?

Bernd Butscheidt bbutscheidt at yahoo.de
Sun Feb 3 11:08:35 CET 2013


>________________________________
> From: Carl Eugen Hoyos <cehoyos at ag.or.at>
>To: ffmpeg-user at ffmpeg.org 
>Sent: Saturday, February 2, 2013 11:22 PM
>Subject: Re: [FFmpeg-user] Proper way to reverse PAL Speed up?

>
>Why do you need the setpts, the asetpts and the aresample 
>filter and the extended map option in your example?


setpts/ asetpts:
This is supposed to to the trick of slowing down the video to the desired frame rate of 23.976 fps. I don't want to skip frames but to alter the length of video and audio, hence to reverse PAL Speedup.

aresample:
Without it, the sound wasn't sound any more. I just get some broken pieces, silence, broken pieces and so on. Also I understood that aresample is the replacement for deprecated async - option ?


extended map option:
They are still there because of previous tries, but as far as I see they have no effect here.




>Alternatively, please provide a sample.


I uploaded a cut version of the source file - the original was 200MB. I choose this one although it is no film material (which means even myself wouldn't apply a speed down to ntsc ..) but because of the speakers one can try to catch the sync/desync the best of all samples I have.

I also uploaded two resulting examples. 


Source file:
http://www.datafilehost.com/download-4ab143a8.html

Output without offset:
http://www.datafilehost.com/download-1be30cba.html

Output with offset:
http://www.datafilehost.com/download-e25ee497.html



Here as described commandline and output, this time without extended mapping:



/extern07/ffmpeg_neu/ffmpeg/ffmpeg -y -i Sport_HD_CUT.ts -vsync 1 -map 0:0 -vcodec libx264 -preset veryfast -x264opts crf=12:videoformat=undef:force-cfr -map 0:4 -acodec ac3 -ab 448k -filter:v setpts=25025/24000*PTS,hqdn3d,delogo=60:48:126:46:5 -filter:a asetpts=25025/24000*PTS+0.0/TB,aresample=48000:async=1:min_comp=0.01:comp_duration=1:max_soft_comp=100000000:min_hard_comp=0.3 -f matroska -r 24000/1001 Sport_HD_CUT_ntsc_0.mkv

ffmpeg version 1.1.git Copyright (c) 2000-2013 the FFmpeg developers
  built on Jan 26 2013 19:21:36 with gcc 4.6.3 (Gentoo Hardened 4.6.3 p1.3, pie-0.5.2)
  configuration: --enable-avresample --enable-gpl --enable-libx264 --enable-nonfree --enable-libmp3lame --enable-libfaac --enable-frei0r --enable-libsoxr --cpu=amd64 --arch=x86_64
  libavutil      52. 16.100 / 52. 16.100
  libavcodec     54. 91.100 / 54. 91.100
  libavformat    54. 61.104 / 54. 61.104
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 33.101 /  3. 33.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[mpegts @ 0x2b1f420] Stream #5: not enough frames to estimate rate; consider increasing probesize
[NULL @ 0x2b26460] start time is not set in estimate_timings_from_pts
[mpegts @ 0x2b1f420] PES packet size mismatch
Input #0, mpegts, from 'Sport_HD_CUT.ts':
  Duration: 00:00:58.07, start: 14960.027511, bitrate: 14038 kb/s                                                         
  Program 132                                                                                                             
    Stream #0:0[0x17de]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 100 tbc                                                                                                        
    Stream #0:1[0x17e8](deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 256 kb/s                        
    Stream #0:2[0x17e9](mis): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s                        
    Stream #0:3[0x17eb](mul): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s                        
    Stream #0:4[0x17ea](deu): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz, stereo, fltp, 448 kb/s                        
    Stream #0:5[0x17f3](deu): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006) (hearing impaired)                           
[libx264 @ 0x2b47ee0] using SAR=1/1                                                                                       
[libx264 @ 0x2b47ee0] using cpu capabilities: MMX2 SSE2Slow SlowCTZ                                                       
[libx264 @ 0x2b47ee0] profile High, level 3.1
[libx264 @ 0x2b47ee0] 264 - core 125 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=crf mbtree=1 crf=12.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, matroska, to 'Sport_HD_CUT_ntsc_0.mkv':
  Metadata:
    encoder         : Lavf54.61.104
    Stream #0:0: Video: h264 (H264 / 0x34363248), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 1k tbn, 23.98 tbc
    Stream #0:1(deu): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp, 448 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libx264)
  Stream #0:4 -> #0:1 (ac3 -> ac3)
Press [q] to stop, [?] for help
frame= 1455 fps= 12 q=-1.0 Lsize=   64568kB time=00:01:00.60 bitrate=8728.0kbits/s dup=0 drop=1448    
video:61232kB audio:3311kB subtitle:0 global headers:0kB muxing overhead 0.038823%
[libx264 @ 0x2b47ee0] frame I:8     Avg QP:10.14  size:226948
[libx264 @ 0x2b47ee0] frame P:460   Avg QP:12.64  size: 85182
[libx264 @ 0x2b47ee0] frame B:987   Avg QP:16.55  size: 21988
[libx264 @ 0x2b47ee0] consecutive B-frames:  6.7%  1.4% 21.9% 70.1%
[libx264 @ 0x2b47ee0] mb I  I16..4:  3.2%  9.2% 87.6%
[libx264 @ 0x2b47ee0] mb P  I16..4:  1.1%  1.1%  1.9%  P16..4: 45.1% 21.4% 26.0%  0.0%  0.0%    skip: 3.4%
[libx264 @ 0x2b47ee0] mb B  I16..4:  0.2%  0.1%  0.1%  B16..8: 22.9% 11.7%  4.5%  direct:20.2%  skip:40.2%  L0:23.0% L1:33.7% BI:43.3%
[libx264 @ 0x2b47ee0] 8x8 transform intra:23.1% inter:25.0%
[libx264 @ 0x2b47ee0] coded y,uvDC,uvAC intra: 86.0% 82.1% 65.9% inter: 38.4% 28.2% 8.1%
[libx264 @ 0x2b47ee0] i16 v,h,dc,p: 34% 34% 24%  8%
[libx264 @ 0x2b47ee0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 29% 26%  2%  5%  4%  5%  4%  6%
[libx264 @ 0x2b47ee0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 25% 17%  3%  9%  6%  7%  5%  7%
[libx264 @ 0x2b47ee0] i8c dc,h,v,p: 43% 29% 18%  9%
[libx264 @ 0x2b47ee0] Weighted P-Frames: Y:0.4% UV:0.2%
[libx264 @ 0x2b47ee0] kb/s:8265.67



==============

/extern07/ffmpeg_neu/ffmpeg/ffmpeg -y -i Sport_HD_CUT.ts -vsync 1 -map 0:0 -vcodec libx264 -preset veryfast -x264opts crf=12:videoformat=undef:force-cfr -map 0:4 -acodec ac3 -ab 448k -filter:v setpts=25025/24000*PTS,hqdn3d,delogo=60:48:126:46:5 -filter:a asetpts=25025/24000*PTS+0.250/TB,aresample=48000:async=1:min_comp=0.01:comp_duration=1:max_soft_comp=100000000:min_hard_comp=0.3 -f matroska -r 24000/1001 Sport_HD_CUT_ntsc_250.mkv

ffmpeg version 1.1.git Copyright (c) 2000-2013 the FFmpeg developers
  built on Jan 26 2013 19:21:36 with gcc 4.6.3 (Gentoo Hardened 4.6.3 p1.3, pie-0.5.2)
  configuration: --enable-avresample --enable-gpl --enable-libx264 --enable-nonfree --enable-libmp3lame --enable-libfaac --enable-frei0r --enable-libsoxr --cpu=amd64 --arch=x86_64
  libavutil      52. 16.100 / 52. 16.100
  libavcodec     54. 91.100 / 54. 91.100
  libavformat    54. 61.104 / 54. 61.104
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 33.101 /  3. 33.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[mpegts @ 0x15b6420] Stream #5: not enough frames to estimate rate; consider increasing probesize
[NULL @ 0x15bd460] start time is not set in estimate_timings_from_pts
[mpegts @ 0x15b6420] PES packet size mismatch
Input #0, mpegts, from 'Sport_HD_CUT.ts':
  Duration: 00:00:58.07, start: 14960.027511, bitrate: 14038 kb/s
  Program 132 
    Stream #0:0[0x17de]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 100 tbc
    Stream #0:1[0x17e8](deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 256 kb/s
    Stream #0:2[0x17e9](mis): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #0:3[0x17eb](mul): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #0:4[0x17ea](deu): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz, stereo, fltp, 448 kb/s
    Stream #0:5[0x17f3](deu): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006) (hearing impaired)
[libx264 @ 0x15deee0] using SAR=1/1
[libx264 @ 0x15deee0] using cpu capabilities: MMX2 SSE2Slow SlowCTZ
[libx264 @ 0x15deee0] profile High, level 3.1
[libx264 @ 0x15deee0] 264 - core 125 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=crf mbtree=1 crf=12.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, matroska, to 'Sport_HD_CUT_ntsc_250.mkv':
  Metadata:
    encoder         : Lavf54.61.104
    Stream #0:0: Video: h264 (H264 / 0x34363248), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 1k tbn, 23.98 tbc
    Stream #0:1(deu): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp, 448 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libx264)
  Stream #0:4 -> #0:1 (ac3 -> ac3)
Press [q] to stop, [?] for help
frame= 1455 fps= 12 q=-1.0 Lsize=   64582kB time=00:01:00.79 bitrate=8702.3kbits/s dup=0 drop=1448    
video:61232kB audio:3325kB subtitle:0 global headers:0kB muxing overhead 0.038899%
[libx264 @ 0x15deee0] frame I:8     Avg QP:10.14  size:226948
[libx264 @ 0x15deee0] frame P:460   Avg QP:12.64  size: 85182
[libx264 @ 0x15deee0] frame B:987   Avg QP:16.55  size: 21988
[libx264 @ 0x15deee0] consecutive B-frames:  6.7%  1.4% 21.9% 70.1%
[libx264 @ 0x15deee0] mb I  I16..4:  3.2%  9.2% 87.6%
[libx264 @ 0x15deee0] mb P  I16..4:  1.1%  1.1%  1.9%  P16..4: 45.1% 21.4% 26.0%  0.0%  0.0%    skip: 3.4%
[libx264 @ 0x15deee0] mb B  I16..4:  0.2%  0.1%  0.1%  B16..8: 22.9% 11.7%  4.5%  direct:20.2%  skip:40.2%  L0:23.0% L1:33.7% BI:43.3%
[libx264 @ 0x15deee0] 8x8 transform intra:23.1% inter:25.0%
[libx264 @ 0x15deee0] coded y,uvDC,uvAC intra: 86.0% 82.1% 65.9% inter: 38.4% 28.2% 8.1%
[libx264 @ 0x15deee0] i16 v,h,dc,p: 34% 34% 24%  8%
[libx264 @ 0x15deee0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 29% 26%  2%  5%  4%  5%  4%  6%
[libx264 @ 0x15deee0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 25% 17%  3%  9%  6%  7%  5%  7%
[libx264 @ 0x15deee0] i8c dc,h,v,p: 43% 29% 18%  9%
[libx264 @ 0x15deee0] Weighted P-Frames: Y:0.4% UV:0.2%
[libx264 @ 0x15deee0] kb/s:8265.67


More information about the ffmpeg-user mailing list