[FFmpeg-trac] #542(undetermined:new): Missing audio when encoding to mpeg-ts with "-threads 0"

FFmpeg trac at avcodec.org
Wed Oct 12 14:43:01 CEST 2011


#542: Missing audio when encoding to mpeg-ts with "-threads 0"
-------------------------------------+-------------------------------------
             Reporter:  terran       |                    Owner:  michael
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
              Version:  git-master   |  undetermined
             Keywords:               |               Resolution:
             Blocking:               |               Blocked By:
Analyzed by developer:  0            |  Reproduced by developer:  0
-------------------------------------+-------------------------------------

Comment (by terran):

 cehoyos: It looks like that command was failing because the libavcodec
 mpeg2 codec doesn't support thread number detection?

 {{{
 $ ffmpeg -i rehearsal.mp4 -qscale 2 -threads 0 out.ts
 ffmpeg version N-33513-g3473639, Copyright (c) 2000-2011 the FFmpeg
 developers
   built on Oct 11 2011 14:54:45 with gcc 4.1.2 20080704 (Red Hat 4.1.2-48)
   configuration: --enable-pthreads --enable-avfilter --enable-shared
 --enable-gpl --enable-version3 --enable-nonfree --enable-libx264 --enable-
 libfaac --enable-libmp3lame
   libavutil    51. 20. 1 / 51. 20. 1
   libavcodec   53. 20. 1 / 53. 20. 1
   libavformat  53. 15. 0 / 53. 15. 0
   libavdevice  53.  4. 0 / 53.  4. 0
   libavfilter   2. 43. 6 /  2. 43. 6
   libswscale    2.  1. 0 /  2.  1. 0
   libpostproc  51.  2. 0 / 51.  2. 0

 Seems stream 0 codec frame rate differs from container frame rate: 59.94
 (60000/1001) -> 29.97 (2997/100)
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'rehearsal.mp4':
   Metadata:
     major_brand     : mp42
     minor_version   : 0
     compatible_brands: mp42mp41
     creation_time   : 2011-08-17 04:36:21
   Duration: 00:12:29.95, start: 0.000000, bitrate: 30155 kb/s
     Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p,
 1920x1080 [SAR 1:1 DAR 16:9], 29995 kb/s, 29.97 fps, 29.97 tbr, 29970 tbn,
 59.94 tbc
     Metadata:
       creation_time   : 2011-08-17 04:36:21
     Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo,
 s16, 157 kb/s
     Metadata:
       creation_time   : 2011-08-17 04:36:21
 File 'out.ts' already exists. Overwrite ? [y/N] y
 w:1920 h:1080 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:
 [mpeg2video @ 0x1e091d20] automatic thread number detection not supported
 by codec, patch welcome
 Output #0, mpegts, to 'out.ts':
   Metadata:
     major_brand     : mp42
     minor_version   : 0
     compatible_brands: mp42mp41
     creation_time   : 2011-08-17 04:36:21
     Stream #0:0(eng): Video: mpeg2video, yuv420p, 1920x1080 [SAR 1:1 DAR
 16:9], q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
     Metadata:
       creation_time   : 2011-08-17 04:36:21
     Stream #0:1(eng): Audio: none, 48000 Hz, stereo, s16, 128 kb/s
     Metadata:
       creation_time   : 2011-08-17 04:36:21
 Stream mapping:
   Stream #0.0 -> #0.0 (h264 -> mpeg2video)
   Stream #0.1 -> #0.1 (aac -> mp2)
 Error while opening encoder for output stream #0.0 - maybe incorrect
 parameters such as bit_rate, rate, width or height
 }}''''''}

 Changing to "-threads 1" worked and produced and mpeg-ts/mpeg2 that
 contained a valid audio stream:

 {{{
 fmpeg version N-33513-g3473639, Copyright (c) 2000-2011 the FFmpeg
 developers
   built on Oct 11 2011 14:54:45 with gcc 4.1.2 20080704 (Red Hat 4.1.2-48)
   configuration: --enable-pthreads --enable-avfilter --enable-shared
 --enable-gpl --enable-version3 --enable-nonfree --enable-libx264 --enable-
 libfaac --enable-libmp3lame
   libavutil    51. 20. 1 / 51. 20. 1
   libavcodec   53. 20. 1 / 53. 20. 1
   libavformat  53. 15. 0 / 53. 15. 0
   libavdevice  53.  4. 0 / 53.  4. 0
   libavfilter   2. 43. 6 /  2. 43. 6
   libswscale    2.  1. 0 /  2.  1. 0
   libpostproc  51.  2. 0 / 51.  2. 0

 Seems stream 0 codec frame rate differs from container frame rate: 59.94
 (60000/1001) -> 29.97 (2997/100)
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'rehearsal_long.mp4':
   Metadata:
     major_brand     : mp42
     minor_version   : 0
     compatible_brands: mp42mp41
     creation_time   : 2011-08-17 04:36:21
   Duration: 00:12:29.95, start: 0.000000, bitrate: 30155 kb/s
     Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p,
 1920x1080 [SAR 1:1 DAR 16:9], 29995 kb/s, 29.97 fps, 29.97 tbr, 29970 tbn,
 59.94 tbc
     Metadata:
       creation_time   : 2011-08-17 04:36:21
     Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo,
 s16, 157 kb/s
     Metadata:
       creation_time   : 2011-08-17 04:36:21
 [buffer @ 0xc02d160] w:1920 h:1080 pixfmt:yuv420p tb:1/1000000 sar:1/1
 sws_param:
 [mpegts @ 0xbffb040] muxrate VBR, pcr every 2 pkts, sdt every 200, pat/pmt
 every 40 pkts
 Output #0, mpegts, to 'out.ts':
   Metadata:
     major_brand     : mp42
     minor_version   : 0
     compatible_brands: mp42mp41
     creation_time   : 2011-08-17 04:36:21
     encoder         : Lavf53.15.0
     Stream #0:0(eng): Video: mpeg2video, yuv420p, 1920x1080 [SAR 1:1 DAR
 16:9], q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
     Metadata:
       creation_time   : 2011-08-17 04:36:21
     Stream #0:1(eng): Audio: mp2, 48000 Hz, stereo, s16, 128 kb/s
     Metadata:
       creation_time   : 2011-08-17 04:36:21
 Stream mapping:
   Stream #0.0 -> #0.0 (h264 -> mpeg2video)
   Stream #0.1 -> #0.1 (aac -> mp2)
 Press [q] to stop, [?] for help
 frame=  150 fps= 25 q=2.0 Lsize=   13272kB time=00:00:04.97
 bitrate=21868.3kbits/s dup=1 drop=0
 video:12215kB audio:78kB global headers:0kB muxing overhead 7.956972%
 }}}

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/542#comment:11>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list