Opened 8 years ago

Last modified 7 years ago

#5709 open defect

Using lavc option sar breaks muxing

Reported by: kwsk Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: aspect
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
Failed to find codec in Stream #0:1
It was no problem in 3.0.2
Stream #0:1 is Audio: aac (LC)

How to reproduce:

/root/ffmpeg-3.1.1/ffmpeg -y -i input.ts -metadata creation_time="$(date --utc +'%F%T')" -vcodec h264_qsv -b:v 2200k -sar 16:9 -s 1280\x720 -acodec copy -absf aac_adtstoasc -bufsize 20000k -maxrate 25000k -movflags faststart -f mp4 "/mnt/hdd/recorded/output.mp4"
ffmpeg version 3.1.1 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
  configuration: --enable-static --enable-gpl --enable-nonfree --disable-doc --disable-ffserver --enable-pthreads --enable-libmfx
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 47.100 /  6. 47.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
C/N = 29.002180dB
Recording...
Available sid = 1040 1041 1424 
Chosen sid    = 1040
Available PMT = 0x110 0x120 0x1fc8 
[mpeg2video @ 0x32d8280] Invalid frame dimensions 0x0.
    Last message repeated 3 times
[mpegts @ 0x32d3660] Could not find codec parameters for stream 4 (Unknown: none ([13][0][0][0] / 0x000D)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x32d3660] Could not find codec parameters for stream 5 (Unknown: none ([13][0][0][0] / 0x000D)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x32d3660] Could not find codec parameters for stream 6 (Unknown: none ([13][0][0][0] / 0x000D)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x32d3660] Could not find codec parameters for stream 7 (Unknown: none ([13][0][0][0] / 0x000D)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x32d3660] Could not find codec parameters for stream 8 (Unknown: none ([13][0][0][0] / 0x000D)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x32d3660] Could not find codec parameters for stream 9 (Unknown: none ([13][0][0][0] / 0x000D)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x32d3660] Could not find codec parameters for stream 10 (Unknown: none ([13][0][0][0] / 0x000D)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'pipe:':
  Duration: N/A, start: 7829.753300, bitrate: N/A
  Program 1040 
    Stream #0:0[0x111]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, bt709), 1440x1080 [SAR 4:3 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x112]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 200 kb/s
    Stream #0:2[0x116]: Data: bin_data ([6][0][0][0] / 0x0006)
    Stream #0:3[0x117]: Data: bin_data ([6][0][0][0] / 0x0006)
    Stream #0:4[0x511]: Unknown: none ([13][0][0][0] / 0x000D)
    Stream #0:5[0x513]: Unknown: none ([13][0][0][0] / 0x000D)
    Stream #0:6[0x514]: Unknown: none ([13][0][0][0] / 0x000D)
    Stream #0:7[0x611]: Unknown: none ([13][0][0][0] / 0x000D)
    Stream #0:8[0x612]: Unknown: none ([13][0][0][0] / 0x000D)
    Stream #0:9[0x613]: Unknown: none ([13][0][0][0] / 0x000D)
    Stream #0:10[0x711]: Unknown: none ([13][0][0][0] / 0x000D)
libva info: VA-API version 0.99.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0
[mp4 @ 0x4156fc0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[mp4 @ 0x4156fc0] Aspect ratio mismatch between muxer (1/1) and encoder layer (16/9)
Output #0, mp4, to '/mnt/hdd/recorded/test.mp4':
  Metadata:
    creation_time   : 2016-07-1414:07:49
    Stream #0:0: Video: h264 (h264_qsv), nv12, 1280x720 [SAR 16:9 DAR 256:81], q=2-31, 2200 kb/s, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc57.48.101 h264_qsv
    Side data:
      cpb: bitrate max/min/avg: 25000000/0/2200000 buffer size: 20000000 vbv_delay: -1
    Stream #0:1: Unknown: none  // Here
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (h264_qsv))
  Stream #0:1 -> #0:1 (copy)
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
write: Broken pipe

SIGPIPE received. cleaning up...
Recorded 7sec


No problem in 3.0.1

  Metadata:
    creation_time   : 2016-07-1414:18:17
    encoder         : Lavf57.25.100
    Stream #0:0: Video: h264 (h264_qsv) ([33][0][0][0] / 0x0021), nv12, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 2200 kb/s, 29.97 fps, 30k tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc57.24.102 h264_qsv
    Side data:
      unknown side data type 10 (24 bytes)
    Stream #0:1: Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 191 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (h264_qsv))
  Stream #0:1 -> #0:1 (copy)
frame=   85 fps=0.0 q=-0.0 size=     224kB time=00:00:02.58 bitrate= 710.9kbits/s dup=19 drop=0 speed= 5frame=  126 fps=122 q=-0.0 size=     614kB time=00:00:03.92 bitrate=1280.8kbits/s dup=19 drop=0 speed= 3frame=  139 fps= 88 q=-0.0 size=     734kB time=00:00:04.48 bitrate=1341.7kbits/s dup=19 drop=0 speed=2.frame=  156 fps= 74 q=-0.0 size=     896kB time=00:00:05.01 bitrate=1463.5kbits/s dup=19 drop=0 speed=2.

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Change History (4)

comment:1 by kwsk, 8 years ago

Component: undeterminedffmpeg
Version: unspecified

comment:2 by Carl Eugen Hoyos, 8 years ago

Component: ffmpegundetermined
Version: unspecified

I agree that there is an issue but the way you describe is clearly invalid: I don't think the command line you provide works with 3.0, please test (again).

And please test current FFmpeg git head, this is required for a valid bug report.

comment:3 by kwsk, 8 years ago

I tried it with git head (N-81008-g87e9cef)
But, It failed with same error

I uploaded sample file for test
http://www.pastefile.com/LeKStM

Last edited 8 years ago by kwsk (previous) (diff)

comment:4 by Carl Eugen Hoyos, 7 years ago

Keywords: aspect added
Reproduced by developer: set
Status: newopen
Summary: Failed to find codec in Stream #0:1Using lavc option sar breaks muxing
Version: unspecifiedgit-master

"Regression" since abb69a2f2ba830c0f2557663915a38a9e5b57e61
I have asked what this commit fixes but did not get an answer:
https://ffmpeg.org/pipermail/ffmpeg-devel/2016-August/197593.html
Since I don't understand how above commit is meant to work, I don't know how to fix this issue.

$ ffmpeg -i fate-suite/8bps/full9iron-partial.mov -sar 1 -f null -an -
ffmpeg version N-82994-ge8651f5 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      55. 43.100 / 55. 43.100
  libavcodec     57. 70.101 / 57. 70.101
  libavformat    57. 61.100 / 57. 61.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 68.100 /  6. 68.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'fate-suite/8bps/full9iron-partial.mov':
  Metadata:
    creation_time   : 2003-05-03T12:47:03.000000Z
    premiere_version: Created with Adobe Premiere 6.5
    quicktime_version: Created with QuickTime 4.0 or later
  Duration: 00:00:13.52, start: 0.000000, bitrate: 620 kb/s
    Stream #0:0(eng): Video: 8bps (8BPS / 0x53504238), pal8, 360x240, 8072 kb/s, SAR 9:10 DAR 27:20, 12.50 fps, 12.50 tbr, 125 tbn, 125 tbc (default)
    Metadata:
      creation_time   : 2003-05-03T12:47:03.000000Z
      handler_name    : Apple Alias Data Handler
      encoder         : Planar RGB
    Stream #0:1(eng): Audio: pcm_u8 (raw  / 0x20776172), 22050 Hz, mono, u8, 176 kb/s (default)
    Metadata:
      creation_time   : 2003-05-03T12:48:24.000000Z
      handler_name    : Apple Alias Data Handler
st: 9/10, par: 1/1
[null @ 0x2fc4ee0] Aspect ratio mismatch between muxer (9/10) and encoder layer (1/1)
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Stream mapping:
  Stream #0:0 -> #0:0 (8bps (native) -> wrapped_avframe (native))
    Last message repeated 1 times

Also related to #5933.

Note: See TracTickets for help on using tickets.