Opened 11 years ago

Closed 11 years ago

#1840 closed defect (invalid)

Error track 2: could not find tag, codec not currently supported in container

Reported by: Atarikid Owned by:
Priority: normal Component: avformat
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

When I try to convert a mkv file and want to copy the subtitles too it gives me the following error:
track 2: could not find tag, codec not currently supported in container

FFmpeg commandline:
/Users/atarikid/Desktop/ffmpeg -i /Volumes/Data/Movies/Homeland.mkv -c:a aac -c:v libx264 -strict -2 -c:s copy /Users/atarikid/Desktop/test.mp4

Output:
ffmpeg version N-45858-gc68a8a1 Copyright (c) 2000-2012 the FFmpeg developers

built on Oct 22 2012 20:28:25 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
configuration: --prefix=/Volumes/tempdisk/sw --as=yasm --enable-gpl --enable-pthreads --disable-ffplay --disable-ffserver --disable-shared --enable-static --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-avfilter --enable-fontconfig --enable-libfreetype --enable-libass --enable-filters --enable-postproc --enable-runtime-cpudetect
libavutil 51. 77.100 / 51. 77.100
libavcodec 54. 68.100 / 54. 68.100
libavformat 54. 33.100 / 54. 33.100
libavdevice 54. 3.100 / 54. 3.100
libavfilter 3. 20.104 / 3. 20.104
libswscale 2. 1.101 / 2. 1.101
libswresample 0. 16.100 / 0. 16.100
libpostproc 52. 1.100 / 52. 1.100

Input #0, matroska,webm, from '/Volumes/Data/Movies/Homeland.mkv':

Metadata:

creation_time : 2012-10-22 09:28:49

Duration: 00:02:01.51, start: 0.000000, bitrate: 2954 kb/s

Stream #0:0(eng): Video: h264 (High), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 2k tbc
Metadata:

title : Homeland.S02E01.The.Smile.720p.WEB-DL.DD5.1.H.264-DON

Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), s16, 384 kb/s
Stream #0:2(dut): Subtitle: subrip (default) (forced)
Metadata:

title : Nederlands QoQ-Team

File '/Users/atarikid/Desktop/test.mp4' already exists. Overwrite ? [y/N] y
using SAR=1/1
[libx264 @ 0x7ff0938e6000] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX
[libx264 @ 0x7ff0938e6000] profile High, level 3.1
[libx264 @ 0x7ff0938e6000] 264 - core 128 r2216 198a7ea - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - 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=12 lookahead_threads=2 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
[mp4 @ 0x7ff093874200] track 2: could not find tag, codec not currently supported in container
Output #0, mp4, to '/Users/xtophe/Desktop/test.mp4':

Metadata:

encoder : Lavf54.33.100
Stream #0:0(eng): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 11988 tbn, 23.98 tbc
Metadata:

title : Homeland.S02E01.The.Smile.720p.WEB-DL.DD5.1.H.264-DON

Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, 5.1(side), fltp, 128 kb/s
Stream #0:2(dut): Subtitle: subrip (default) (forced)
Metadata:

title : Nederlands QoQ-Team

Stream mapping:

Stream #0:0 -> #0:0 (h264 -> libx264)
Stream #0:1 -> #0:1 (ac3 -> aac)
Stream #0:2 -> #0:2 (copy)

Could not write header for output file #0 (incorrect codec parameters ?): Operation not permitted

If I remove the -c:s copy it compiles fine but without the subtitles.

BTW Tried it with Handbrake and it converts fine with subtitles.

Change History (10)

comment:1 by Atarikid, 11 years ago

If you want an example file then let me know. It is about 45MB

comment:2 by Elon Musk, 11 years ago

Resolution: invalid
Status: newclosed

AFAIK subtitle codec subrip is not supported in mp4 container, so you cannot copy it: see error message above: [mp4 @ 0x7ff093874200] track 2: could not find tag, codec not currently supported in container.

If subrip is supported by mp4 spec please reopen bug with link to such spec.

comment:3 by Atarikid, 11 years ago

Obvious.. stupid me. BUT ...

When I use -c:s mov_text instead of copy it compiles correctly but the subtitles do not work when using QuickTime Player.
The subtitles however do work when using VLC

Any thoughts why it isn't playing on QT player (OSX)?

comment:4 by Elon Musk, 11 years ago

And there are mp4s with subtitles that QT can play?
If there are such files and they also use mov_text (as detected by ffmpeg) please open new bug report.

comment:5 by Atarikid, 11 years ago

Yes, when you encode with FFmpeg to mp4 with mov_text they play fine with QT Player.
I will open a new ticket asap

comment:6 by Atarikid, 11 years ago

This should read : .. Yes, when you encode with HANDBRAKE to mp4 with mov_text they ..

comment:7 by compn, 11 years ago

Priority: normalwish
Resolution: invalid
Status: closedreopened
Summary: Error track 2: could not find tag, codec not currently supported in container"codec not currently supported in container" should give a recommendation for 3gpp timed text subs
Type: defectenhancement

i think what the user wants is an idea how to convert to movtext aka "3gpp timed text" in mov.

the error message could return this info, since 3gpp timed text is the only supported mp4 subs anyhow.

in reply to:  7 comment:8 by Carl Eugen Hoyos, 11 years ago

Replying to compn:

i think what the user wants is an idea how to convert to movtext aka "3gpp timed text" in mov.

Since I am not sure I understand your suggestion:
Could you add a PoC patch / hack that shows what you suggest?

the error message could return this info, since 3gpp timed text is the only supported mp4 subs anyhow.

We do have dvdsub sample (that plays fine).

comment:9 by compn, 11 years ago

well his bug is that , when using ffmpeg to create an mp4 file with text subs, the subs do not work in quicktime. i have just reproduced this with ffmpeg and quicktime.

C:\>ffmpeg -i SAMPLE.AVI -i test.srt -c:s mov_text out.mp4
ffmpeg version N-47062-g26c531c Copyright (c) 2000-2012 the FFmpeg developers

built on Nov 25 2012 12:21:26 with gcc 4.7.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-pthreads --enable-runtime-cpudetect --enab

le-avisynth --enable-bzlib --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libop
encore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libop
enjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheo
ra --enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-lib
vpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib

libavutil 52. 9.100 / 52. 9.100
libavcodec 54. 77.100 / 54. 77.100
libavformat 54. 37.100 / 54. 37.100
libavdevice 54. 3.100 / 54. 3.100
libavfilter 3. 23.102 / 3. 23.102
libswscale 2. 1.102 / 2. 1.102
libswresample 0. 17.101 / 0. 17.101
libpostproc 52. 2.100 / 52. 2.100

Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, avi, from 'SAMPLE.AVI':

Duration: 00:00:07.00, start: 0.000000, bitrate: 1168 kb/s

Stream #0:0: Video: cinepak (cvid / 0x64697663), yuv420p, 320x240, 15 tbr, 15 tbn, 15 tbc
Stream #0:1: Audio: pcm_u8 ([1][0][0][0] / 0x0001), 22050 Hz, mono, u8, 176 kb/s

[srt @ 024f0140] Estimating duration from bitrate, this may be inaccurate
Input #1, srt, from 'test.srt':

Duration: N/A, bitrate: N/A

Stream #1:0: Subtitle: subrip

[libx264 @ 024f44c0] using cpu capabilities: MMX2 SSE2Slow SlowCTZ
[libx264 @ 024f44c0] profile High, level 1.2
[libx264 @ 024f44c0] 264 - core 128 r2216 198a7ea - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - ht
tp://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subm
e=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=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 i
nterlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 we
ightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=15 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 'out.mp4':

Metadata:

encoder : Lavf54.37.100
Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 320x240, q=-1--1, 500k tbn, 15 tbc
Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 22050 Hz, mono, s16, 128 kb/s
Stream #0:2: Subtitle: mov_text ([8][0][0][0] / 0x0008)

Stream mapping:

Stream #0:0 -> #0:0 (cinepak -> libx264)
Stream #0:1 -> #0:1 (pcm_u8 -> libvo_aacenc)
Stream #1:0 -> #0:2 (subrip -> mov_text)

Press [q] to stop, ? for help
frame= 105 fps= 18 q=27.0 Lsize= 657kB time=00:00:07.03 bitrate= 765.6kbits/s
video:541kB audio:111kB subtitle:0 global headers:0kB muxing overhead 0.748301%
[libx264 @ 024f44c0] frame I:6 Avg QP:24.73 size: 8226
[libx264 @ 024f44c0] frame P:83 Avg QP:25.75 size: 5226
[libx264 @ 024f44c0] frame B:16 Avg QP:27.47 size: 4400
[libx264 @ 024f44c0] consecutive B-frames: 69.5% 30.5% 0.0% 0.0%
[libx264 @ 024f44c0] mb I I16..4: 47.5% 3.6% 48.9%
[libx264 @ 024f44c0] mb P I16..4: 32.6% 9.3% 26.0% P16..4: 16.1% 9.3% 4.5% 0.0% 0.0% skip:

2.2%

[libx264 @ 024f44c0] mb B I16..4: 7.0% 1.4% 11.3% B16..8: 25.6% 17.0% 10.4% direct:24.5% skip:

2.9% L0:40.8% L1:36.2% BI:23.0%

[libx264 @ 024f44c0] 8x8 transform intra:12.5% inter:10.2%
[libx264 @ 024f44c0] coded y,uvDC,uvAC intra: 80.5% 90.2% 74.3% inter: 67.8% 55.6% 10.7%
[libx264 @ 024f44c0] i16 v,h,dc,p: 17% 25% 41% 16%
[libx264 @ 024f44c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14% 17% 54% 3% 1% 2% 2% 2% 4%
[libx264 @ 024f44c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 27% 29% 3% 1% 1% 1% 2% 2%
[libx264 @ 024f44c0] i8c dc,h,v,p: 61% 20% 15% 5%
[libx264 @ 024f44c0] Weighted P-Frames: Y:8.4% UV:6.0%
[libx264 @ 024f44c0] ref P L0: 64.0% 15.7% 15.1% 5.0% 0.1%
[libx264 @ 024f44c0] ref B L0: 83.4% 16.6%
[libx264 @ 024f44c0] kb/s:632.58

here is a mov file with closed captions that works in quicktime:
http://www.cpcweb.com/webcasts/cpcdemo.mov
i could not get these to work with ffplay. i'm not sure if they are '3gpp timed text' or something else.

here is psuedo code for better error message:
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index f08aa7e..3258597 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -3586,6 +3586,9 @@ static int mov_write_header(AVFormatContext *s)

if (!track->tag) {

av_log(s, AV_LOG_ERROR, "track %d: could not find tag, "

"codec not currently supported in container\n", i);

+ if (!track->subtitletag) {
+ av_log(s, AV_LOG_ERROR, "track %d: subtitle tag not standard in mov, "
+ "please try -c:s mov_text\n", i);

goto error;

}
/* If hinting of this track is enabled by a later hint track,

comment:10 by Carl Eugen Hoyos, 11 years ago

Component: FFmpegavformat
Priority: wishnormal
Resolution: invalid
Status: reopenedclosed
Summary: "codec not currently supported in container" should give a recommendation for 3gpp timed text subsError track 2: could not find tag, codec not currently supported in container
Type: enhancementdefect
Note: See TracTickets for help on using tickets.