[FFmpeg-user] keeping subtitles while transcoding

Rick C. rickcorteza at gmail.com
Mon Jan 23 07:58:37 CET 2012


On Jan 22, 2012, at 10:53 PM, Carl Eugen Hoyos wrote:

> Rick C. <rickcorteza <at> gmail.com> writes:
> 
>>>> I think .mp4 does support subtitles, but coming from .mkv using
>>>> -scodec copy doesn't seem to work.  If you go from .mp4 to .mp4 using
>>>> -scodec copy it works.
>>> 
>>> Have you got an working example?
>>> I ask because ticket 756 suggests it does not work.
>> 
>> I'd be happy to help what would you like the output?
> 
> A command line together with complete, uncut console output (and some
> explanation which application plays the resulting file) would be a good start.
> 
>> I think it was from a movie and it's a bit large to upload...
> 
> For subtitle issues, 10MB are often enough to reproduce...
> 
> Carl Eugen
> 


Sure Carl I have uploaded the output video and the subtitles have been successfully copied and play in VLC.  Here is the link:

http://www.datafilehost.com/download-1763eb4a.html

And here is the conversion output let me know if you need anything else:


Last login: Mon Jan 23 14:44:33 on ttys001
mahalkos-iMac:~ mahalko$ /Users/mahalko/Desktop/ffmpeg -i /Users/mahalko/Music/iTunes/iTunes\ Music/Movies/The\ Hangover\ Part\ II\ \(HD\).m4v -scodec copy -strict experimental -t 120 /Users/mahalko/Desktop/test.mp4
ffmpeg version 0.9, Copyright (c) 2000-2011 the FFmpeg developers
  built on Dec 18 2011 16:33:23 with gcc 4.2.1 (Apple Inc. build 5666) (dot 3)
  configuration: --prefix=/Volumes/Ramdisk/sw --enable-gpl --enable-pthreads --enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --arch=x86_64 --enable-runtime-cpudetect
  libavutil    51. 32. 0 / 51. 32. 0
  libavcodec   53. 42. 0 / 53. 42. 0
  libavformat  53. 24. 0 / 53. 24. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 53. 0 /  2. 53. 0
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  51.  2. 0 / 51.  2. 0

Seems stream 5 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 0.00 (1/300)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/mahalko/Music/iTunes/iTunes Music/Movies/The Hangover Part II (HD).m4v':
  Metadata:
    major_brand     : MSNV
    minor_version   : 512
    compatible_brands: isomiso2avc1MSNV
    creation_time   : 1970-01-01 00:00:00
    description     : Two years after the bachelor party in Las Vegas, Phil, Stu, Alan, and Doug jet to Thailand for Stu's wedding. Stu's plan for a subdued pre-wedding brunch, however, goes seriously awry.
    synopsis        : Two years after the bachelor party in Las Vegas, Phil, Stu, Alan, and Doug jet to Thailand for Stu's wedding. Stu's plan for a subdued pre-wedding brunch, however, goes seriously awry.
    hd_video        : 1
    title           : The Hangover Part II
    artist          : HolyRoses
    date            : 2011-05-26T07:00:00Z
    comment         : A HolyRoses Production - https://thepiratebay.org/user/HolyRoses/
    media_type      : 9
    copyright       : © 2011 HolyRoses. All Rights Reserved.
    genre           : Comedy
    encoder         : HolyRoses
  Duration: 01:41:49.76, start: 0.000000, bitrate: 3621 kb/s
    Chapter #0.0: start 0.000000, end 300.000000
    Metadata:
      title           : Chapter 1
    Chapter #0.1: start 300.000000, end 600.000000
    Metadata:
      title           : Chapter 2
    Chapter #0.2: start 600.000000, end 900.000000
    Metadata:
      title           : Chapter 3
    Chapter #0.3: start 900.000000, end 1200.000000
    Metadata:
      title           : Chapter 4
    Chapter #0.4: start 1200.000000, end 1500.000000
    Metadata:
      title           : Chapter 5
    Chapter #0.5: start 1500.000000, end 1800.000000
    Metadata:
      title           : Chapter 6
    Chapter #0.6: start 1800.000000, end 2100.000000
    Metadata:
      title           : Chapter 7
    Chapter #0.7: start 2100.000000, end 2400.000000
    Metadata:
      title           : Chapter 8
    Chapter #0.8: start 2400.000000, end 2700.000000
    Metadata:
      title           : Chapter 9
    Chapter #0.9: start 2700.000000, end 3000.000000
    Metadata:
      title           : Chapter 10
    Chapter #0.10: start 3000.000000, end 3300.000000
    Metadata:
      title           : Chapter 11
    Chapter #0.11: start 3300.000000, end 3600.000000
    Metadata:
      title           : Chapter 12
    Chapter #0.12: start 3600.000000, end 3900.000000
    Metadata:
      title           : Chapter 13
    Chapter #0.13: start 3900.000000, end 4200.000000
    Metadata:
      title           : Chapter 14
    Chapter #0.14: start 4200.000000, end 4500.000000
    Metadata:
      title           : Chapter 15
    Chapter #0.15: start 4500.000000, end 4800.000000
    Metadata:
      title           : Chapter 16
    Chapter #0.16: start 4800.000000, end 5100.000000
    Metadata:
      title           : Chapter 17
    Chapter #0.17: start 5100.000000, end 5400.000000
    Metadata:
      title           : Chapter 18
    Chapter #0.18: start 5400.000000, end 5700.000000
    Metadata:
      title           : Chapter 19
    Chapter #0.19: start 5700.000000, end 6108.769000
    Metadata:
      title           : Chapter 20
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x534 [SAR 1:1 DAR 640:267], 3070 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 159 kb/s
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : 
    Stream #0:2(eng): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), s16, 384 kb/s
    Metadata:
      creation_time   : 2011-11-17 23:20:02
      handler_name    : 
    Stream #0:3(eng): Subtitle: mov_text (tx3g / 0x67337874)
    Metadata:
      creation_time   : 2011-11-17 23:20:02
      handler_name    : 
    Stream #0:4(eng): Subtitle: mov_text (text / 0x74786574)
    Metadata:
      creation_time   : 2011-11-17 23:20:08
      handler_name    : 
    Stream #0:5(eng): Video: mjpeg (jpeg / 0x6765706A), yuvj420p, 640x267 [SAR 1:1 DAR 640:267], 1 kb/s, 0k fps, 0k tbr, 1k tbn, 1k tbc
    Metadata:
      creation_time   : 2011-11-17 23:20:15
      handler_name    : 
[buffer @ 0x10151a180] w:1280 h:534 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:
[libx264 @ 0x101839c00] using SAR=1/1
[libx264 @ 0x101839c00] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX
[libx264 @ 0x101839c00] profile High, level 3.1
[libx264 @ 0x101839c00] 264 - core 119 - H.264/MPEG-4 AVC codec - Copyleft 2003-2011 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 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=2 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/Users/mahalko/Desktop/test.mp4':
  Metadata:
    major_brand     : MSNV
    minor_version   : 512
    compatible_brands: isomiso2avc1MSNV
    creation_time   : 1970-01-01 00:00:00
    description     : Two years after the bachelor party in Las Vegas, Phil, Stu, Alan, and Doug jet to Thailand for Stu's wedding. Stu's plan for a subdued pre-wedding brunch, however, goes seriously awry.
    synopsis        : Two years after the bachelor party in Las Vegas, Phil, Stu, Alan, and Doug jet to Thailand for Stu's wedding. Stu's plan for a subdued pre-wedding brunch, however, goes seriously awry.
    hd_video        : 1
    title           : The Hangover Part II
    artist          : HolyRoses
    date            : 2011-05-26T07:00:00Z
    comment         : A HolyRoses Production - https://thepiratebay.org/user/HolyRoses/
    media_type      : 9
    copyright       : © 2011 HolyRoses. All Rights Reserved.
    genre           : Comedy
    encoder         : Lavf53.24.0
    Chapter #0.0: start 0.000000, end 120.000000
    Metadata:
      title           : Chapter 1
    Stream #0:0(eng): Video: h264 (![0][0][0] / 0x0021), yuv420p, 1280x534 [SAR 1:1 DAR 640:267], q=-1--1, 24k tbn, 23.98 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (@[0][0][0] / 0x0040), 48000 Hz, 5.1(side), s16, 128 kb/s
    Metadata:
      creation_time   : 2011-11-17 23:20:02
      handler_name    : 
    Stream #0:2(eng): Subtitle: mov_text ([8][0][0][0] / 0x0008)
    Metadata:
      creation_time   : 2011-11-17 23:20:02
      handler_name    : 
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libx264)
  Stream #0:2 -> #0:1 (ac3 -> aac)
  Stream #0:3 -> #0:2 (copy)
Press [q] to stop, [?] for help
frame= 2878 fps= 45 q=28.0 Lsize=   26185kB time=00:01:59.28 bitrate=1798.3kbits/s    
video:25061kB audio:1046kB global headers:0kB muxing overhead 0.303243%
[libx264 @ 0x101839c00] frame I:27    Avg QP:18.42  size: 56276
[libx264 @ 0x101839c00] frame P:1523  Avg QP:23.18  size: 13600
[libx264 @ 0x101839c00] frame B:1328  Avg QP:25.82  size:  2582
[libx264 @ 0x101839c00] consecutive B-frames: 29.1% 24.9%  9.7% 36.3%
[libx264 @ 0x101839c00] mb I  I16..4: 20.0% 56.8% 23.1%
[libx264 @ 0x101839c00] mb P  I16..4:  4.4%  8.9%  1.5%  P16..4: 40.5% 13.1%  6.7%  0.0%  0.0%    skip:24.9%
[libx264 @ 0x101839c00] mb B  I16..4:  0.1%  0.5%  0.1%  B16..8: 40.7%  2.6%  0.4%  direct: 1.0%  skip:54.5%  L0:38.0% L1:57.0% BI: 5.0%
[libx264 @ 0x101839c00] 8x8 transform intra:60.1% inter:72.8%
[libx264 @ 0x101839c00] coded y,uvDC,uvAC intra: 47.9% 63.7% 26.5% inter: 13.8% 19.7% 1.6%
[libx264 @ 0x101839c00] i16 v,h,dc,p: 57% 18%  8% 18%
[libx264 @ 0x101839c00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 16% 24%  6%  7%  8%  7%  6%  7%
[libx264 @ 0x101839c00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 17% 14%  6%  8%  9%  8%  6%  6%
[libx264 @ 0x101839c00] i8c dc,h,v,p: 53% 19% 22%  6%
[libx264 @ 0x101839c00] Weighted P-Frames: Y:8.3% UV:7.2%
[libx264 @ 0x101839c00] ref P L0: 69.9% 14.1% 11.5%  4.4%  0.2%
[libx264 @ 0x101839c00] ref B L0: 91.1%  7.9%  1.0%
[libx264 @ 0x101839c00] ref B L1: 96.2%  3.8%
[libx264 @ 0x101839c00] kb/s:1710.23
mahalkos-iMac:~ mahalko$ 




More information about the ffmpeg-user mailing list