dwbuiten / FFmpeg

mirror of git://git.videolan.org/ffmpeg.git
http://ffmpeg.org
Other
0 stars 1 forks source link

stream detection in vid_0x80.ts breaks without coded_width/height #31

Closed michaelni closed 8 years ago

michaelni commented 8 years ago

I missed this one earlier as i had locally applied my coded_width/height in codecpar patch without that patch for unknown reasons https://samples.ffmpeg.org/MPEG2/vid_0x80.ts fails to have its video stream parameters detected and thus transcoding the video from the file fails

Input #0, mpegts, from 'vid_0x80.ts': Duration: 00:00:01.42, start: 38892.178344, bitrate: 47241 kb/s Program 1 Stream #0:0[0x1e00]: Video: mpeg2video ([128][0][0][0] / 0x0080), yuv420p, 528x480 [SAR 40:33 DAR 4:3], 29.97 fps, 29.97 tbr, 90k tbn Stream #0:10x1020: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 128 kb/s Stream #0:20x1021: Audio: ac3 ([129][0][0][0] / 0x0081), 0 channels

vs.

Input #0, mpegts, from 'vid_0x80.ts': Duration: 00:00:01.42, start: 38892.178344, bitrate: 47241 kb/s Program 1 Stream #0:0[0x1e00]: Video: mpeg2video ([128][0][0][0] / 0x0080), none, 29.97 fps, 29.97 tbr, 90k tbn Stream #0:10x1020: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 128 kb/s Stream #0:20x1021: Audio: ac3 ([129][0][0][0] / 0x0081), 0 channels

michaelni commented 8 years ago

avcodec_parameters_to_context() overwrites the correct width by 0 it seems if that overwrite is prevented then it works

2 0x0000000000b5ff8d in avcodec_parameters_to_context (codec=0x1e8de00, par=0x1e8dd40) at libavcodec/utils.c:3834

3 0x00000000006e4e93 in update_stream_avctx (s=0x1e8a600) at libavformat/utils.c:449

4 0x00000000006e9bf2 in read_frame_internal (s=0x1e8a600, pkt=0x7fffffffda90) at libavformat/utils.c:1606

5 0x00000000006f0050 in avformat_find_stream_info (ic=0x1e8a600, options=0x0) at libavformat/utils.c:3452

6 0x000000000041c8cd in open_input_file (o=0x7fffffffded0, filename=0x7fffffffe753 "/home/michael/videos/vid_0x80.ts") at ffmpeg_opt.c:969

7 0x00000000004255ef in open_files (l=0x1e8a2f8, inout=0x10122b7 "input", open_file=0x41bf6d ) at ffmpeg_opt.c:3003

8 0x000000000042576d in ffmpeg_parse_options (argc=4, argv=0x7fffffffe4a8) at ffmpeg_opt.c:3040

9 0x000000000043ad13 in main (argc=4, argv=0x7fffffffe4a8) at ffmpeg.c:4321

ghost commented 8 years ago

So basically the parser and the decoder are fighting to set the value? What determines the correct value in the first place in this case?

Nevcairiel commented 8 years ago

This would mean that codecpar has empty width/height, which is clearly not as designed. I'll look at this in the morning.

michaelni commented 8 years ago

putting av_logs in decoder and parser shows both seem to set width to 528 before "Demuxer context update while decoder is open" triggers and things get wiped anyway, Ill leave this to Nevcairiel, he knows that code better

Nevcairiel commented 8 years ago

Fixed