VideoHelp Forum
+ Reply to Thread
Results 1 to 8 of 8
Thread
  1. Member Klagar's Avatar
    Join Date
    Sep 2010
    Location
    Montreal, Canada
    Search Comp PM
    Hi,

    I've got this m2t file I have to encode in mp4 using ffmpeg. But when I do, it basically says I can't because the input and output have different frame rates.

    Here's the line I use :

    Code:
    -f mp4 -vcodec libx264 -r 29.97 -s 1920x1080 -aspect 16:9 -b 7000k -b_strategy 2 -bf 2 -cmp +chroma -coder 1 -flags +loop -flags2 +bpyramid+mixed_refs+dct8x8+wpred+fastpskip -g 30 -i_qfactor 0.71 -me_method umh -me_range 16 -partitions +parti8x8+parti4x4+partp8x8+partb8x8 -qcomp 0.6 -qdiff 4 -qmin 1 -refs 3 -subq 6 -threads 0 -trellis 0 -ab 192k -ac 2 -acodec libfaac -ar 44100 -async 1
    And here is the output I get :

    Code:
    FFmpeg version git-N-28606-g26d9a9c-Sherpya, Copyright (c) 2000-2011 the FFmpeg developers
    
    [mpegts @ 015ffb80] Invalid timestamps stream=0, pts=3600, dts=7200, size=54532
    <Repetition>
    [mpegts @ 015ffb80] Invalid timestamps stream=0, pts=133200, dts=136800, size=64000
    
    Seems stream 0 codec frame rate differs from container frame rate: 50.00 (50/1) -> 25.00 (50/2)
    Input #0, mpegts, from 'C:\Input\50297_01.m2t':
      Duration: 00:34:08.04, start: 0.000000, bitrate: 26189 kb/s
      Program 1
        Stream #0.0[0x44]: Video: mpeg2video (Main), yuv420p, 1440x1080 [PAR 4:3 DAR 16:9], 25000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
        Stream #0.1[0x45](eng): Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s (hearing impaired)
    [buffer @ 04097f60] w:1440 h:1080 pixfmt:yuv420p
    [setdar @ 0162acc0] a:16/9
    [scale @ 016bb770] w:1440 h:1080 fmt:yuv420p -> w:1920 h:1080 fmt:yuv420p flags:0x4
    [setdar @ 0162acc0] w:1920 h:1080 -> dar:16/9 par:1/1
    [libx264 @ 04058010] using SAR=1/1
    [libx264 @ 04058010] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2
    [libx264 @ 04058010] profile High, level 4.0
    [libx264 @ 04058010] 264 - core 114 r1924 08d04a4 - H.264/MPEG-4 AVC codec - Copyleft 2003-2011 - http://www.videolan.org/x264.html - options: cabac=
    e=6 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 sl
    ined_intra=0 bframes=2 b_pyramid=2 b_adapt=2 b_bias=0 direct=2 weightb=1 open_gop=0 weightp=0 keyint=30 keyint_min=16 scenecut=0 intra_refresh=0 rc_l
    0 qcomp=0.60 qpmin=1 qpmax=31 qpstep=4 ip_ratio=1.41 aq=1:1.00
    Output #0, mp4, to 'C:\Users\Me\Desktop\Video Test Results\50297_01.mp4':
      Metadata:
        encoder         : Lavf52.103.0
        Stream #0.0: Video: libx264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], q=1-31, 7000 kb/s, 2997 tbn, 29.97 tbc
        Stream #0.1(eng): Audio: libfaac, 44100 Hz, stereo, s16, 192 kb/s (hearing impaired)
    Stream mapping:
      Stream #0.0 -> #0.0
      Stream #0.1 -> #0.1
    Press [q] to stop encoding
    
    [mpegts @ 015ffb80] Invalid timestamps stream=0, pts=3600, dts=7200, size=54532
    <Repetition>
    [mpegts @ 015ffb80] Invalid timestamps stream=0, pts=900000, dts=903600, size=24611
    frame=  152 fps= 13 q=9882577.0 Lsize=    4649kB time=5.01 bitrate=7609.1kbits/s dup=67 drop=0
    video:4456kB audio:186kB global headers:0kB muxing overhead 0.145619%
    frame I:6     Avg QP:18.73  size:140040
    
    [libx264 @ 04058010] frame P:96    Avg QP:20.46  size: 27758
    [libx264 @ 04058010] frame B:50    Avg QP:22.50  size: 21145
    [libx264 @ 04058010] consecutive B-frames: 42.1% 34.2% 23.7%
    [libx264 @ 04058010] mb I  I16..4:  2.6% 87.1% 10.2%
    [libx264 @ 04058010] mb P  I16..4:  0.2%  4.8%  0.3%  P16..4: 26.4%  9.4%  6.2%  0.0%  0.0%    skip:52.6%
    [libx264 @ 04058010] mb B  I16..4:  5.3% 14.2%  0.2%  B16..8: 59.5%  8.2%  0.2%  direct: 2.3%  skip:10.0%  L0:21.3% L1:65.5% BI:13.2%
    [libx264 @ 04058010] final ratefactor: 19.97
    [libx264 @ 04058010] 8x8 transform intra:80.5% inter:57.2%
    [libx264 @ 04058010] coded y,uvDC,uvAC intra: 75.5% 68.2% 23.9% inter: 13.0% 17.1% 0.3%
    [libx264 @ 04058010] i16 v,h,dc,p: 37% 10% 33% 20%
    [libx264 @ 04058010] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29% 10% 32%  3%  5%  5%  4%  6%  5%
    [libx264 @ 04058010] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31% 12% 10%  6% 10% 10%  8%  8%  5%
    [libx264 @ 04058010] i8c dc,h,v,p: 49% 16% 30%  5%
    [libx264 @ 04058010] ref P L0: 78.2%  7.9% 13.9%
    [libx264 @ 04058010] ref B L0: 79.4% 18.5%  2.1%
    [libx264 @ 04058010] ref B L1: 97.1%  2.9%
    [libx264 @ 04058010] kb/s:7196.36
    The out put video plays extremely fast, although the sound seems okay.

    Can anyone see anything that could cause the problem ? Is it something FFmpeg will always have trouble with ? 'cause this is the first of a looong series of files I have to convert, and they're all similar. I don't see myself using any other tool right now, so I'd very much like FFmpeg to be able to process this.

    Thanks in advance for your advice !

    Regards.
    Quote Quote  
  2. FFmpeg has problems with transport streams. You might find ffmbc handles them better

    Why are you converting from 25fps to 29.97 fps ? That's another issue even if FFMpeg worked properly
    Quote Quote  
  3. Originally Posted by poisondeathray View Post
    Why are you converting from 25fps to 29.97 fps ?
    Yeah, makes no sense. 23.976fps, maybe, but not 29.97fps.
    Quote Quote  
  4. Member Klagar's Avatar
    Join Date
    Sep 2010
    Location
    Montreal, Canada
    Search Comp PM
    NTSC Standard ? How does that make no sense ?
    Quote Quote  
  5. Originally Posted by Klagar View Post
    NTSC Standard ? How does that make no sense ?

    It's a difficult conversion. 25 and 29.97 are too far apart. What are you going to do with the audio ? The difference is too great for a simple speedup (~ 1.19x). It will sound like "chimpunks"

    Where are you getting extra frames? Are you going to add blended frames? add duplicate frames? add interpolated frames?

    This conversion would normally be done with a slowdown to 23.976 (audio & video) , with the same # frames, and telecined to 29.97
    Quote Quote  
  6. Member Klagar's Avatar
    Join Date
    Sep 2010
    Location
    Montreal, Canada
    Search Comp PM
    I understand...
    What made me wonder is, I believe I remember having been able in the past to do such a conversion. Maybe with an earlier FFmpeg version. Though you make me doubt that now.
    Indeed, audio there has always been a problem.

    Would you say what I'm trying to do is outright impossible, very problematic, or just not something FFmpeg in particular does well ?
    Quote Quote  
  7. I don't think ffmpeg (alone) has the appropriate tools or filters for this. I don't see anything in libavfilters that could do it. It's possible to do with avisynth + ffmpeg

    Why do you need it at 29.97 ? Is it for broadcast? No NTSC region stations use h.264

    If it's for web (flash), leave it at 25fps
    Quote Quote  
  8. Member Klagar's Avatar
    Join Date
    Sep 2010
    Location
    Montreal, Canada
    Search Comp PM
    Ok then, I shall investigate that. Thanks a lot !
    Quote Quote  



Similar Threads

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