Opened 7 years ago

Closed 7 years ago

#1790 closed defect (invalid)

got mpeg2video instead of expected mpeg1video

Reported by: burek Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I don't know how to name this ticket properly, so please rename it if necessary.

Summary of the bug:

  1. Created a test input file: out1.mpg
  2. Tried to put 2 streams of out1.mpg into out2.ts
  3. Got a weird result

How to reproduce:

1.

# ffmpeg -f lavfi -i testsrc -t 60 out1.mpg
ffmpeg version N-44317-g2474ca1 Copyright (c) 2000-2012 the FFmpeg developers
  built on Sep 10 2012 00:03:51 with gcc 4.6 (Debian 4.6.3-1)
  configuration: --enable-static --enable-shared --enable-gpl --enable-nonfree --enable-postproc --enable-libx264 --enable-libaacplus
  libavutil      51. 72.100 / 51. 72.100
  libavcodec     54. 55.100 / 54. 55.100
  libavformat    54. 25.105 / 54. 25.105
  libavdevice    54.  2.100 / 54.  2.100
  libavfilter     3. 16.101 /  3. 16.101
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[lavfi @ 0x2190260] Estimating duration from bitrate, this may be inaccurate
Input #0, lavfi, from 'testsrc':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 320x240 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
[mpeg @ 0x2191880] VBV buffer size not set, muxing may fail
Output #0, mpeg, to 'out1.mpg':
  Metadata:
    encoder         : Lavf54.25.105
    Stream #0:0: Video: mpeg1video, yuv420p, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo -> mpeg1video)
Press [q] to stop, [?] for help
frame= 1500 fps=379 q=6.6 Lsize=    1784kB time=00:00:59.96 bitrate= 243.7kbits/s
video:1768kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.877842%

2.

# ffmpeg -i out1.mpg -ss 20 -i out1.mpg -map 0 -map 1 -c copy out2.ts
ffmpeg version N-44317-g2474ca1 Copyright (c) 2000-2012 the FFmpeg developers
  built on Sep 10 2012 00:03:51 with gcc 4.6 (Debian 4.6.3-1)
  configuration: --enable-static --enable-shared --enable-gpl --enable-nonfree --enable-postproc --enable-libx264 --enable-libaacplus
  libavutil      51. 72.100 / 51. 72.100
  libavcodec     54. 55.100 / 54. 55.100
  libavformat    54. 25.105 / 54. 25.105
  libavdevice    54.  2.100 / 54.  2.100
  libavfilter     3. 16.101 /  3. 16.101
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[mpeg @ 0xbad240] max_analyze_duration 5000000 reached at 5000000
Input #0, mpeg, from 'out1.mpg':
  Duration: 00:00:59.76, start: 1.000000, bitrate: 244 kb/s
    Stream #0:0[0x1e0]: Video: mpeg1video, yuv420p, 320x240 [SAR 1:1 DAR 4:3], 104857 kb/s, 25 fps, 25 tbr, 90k tbn, 25 tbc
[mpeg @ 0xbb3f40] max_analyze_duration 5000000 reached at 5000000
Input #1, mpeg, from 'out1.mpg':
  Duration: 00:00:59.76, start: 1.000000, bitrate: 244 kb/s
    Stream #1:0[0x1e0]: Video: mpeg1video, yuv420p, 320x240 [SAR 1:1 DAR 4:3], 104857 kb/s, 25 fps, 25 tbr, 90k tbn, 25 tbc
[mpegts @ 0xbb4d60] muxrate VBR, pcr every 2 pkts, sdt every 200, pat/pmt every 40 pkts
Output #0, mpegts, to 'out2.ts':
  Metadata:
    encoder         : Lavf54.25.105
    Stream #0:0: Video: mpeg1video, yuv420p, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 104857 kb/s, 25 fps, 90k tbn, 25 tbc
    Stream #0:1: Video: mpeg1video, yuv420p, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 104857 kb/s, 25 fps, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mpegts @ 0xbb4d60] first pts value must set
av_interleaved_write_frame(): Invalid data found when processing input

3.

# ffmpeg -i out2.ts
ffmpeg version N-44317-g2474ca1 Copyright (c) 2000-2012 the FFmpeg developers
  built on Sep 10 2012 00:03:51 with gcc 4.6 (Debian 4.6.3-1)
  configuration: --enable-static --enable-shared --enable-gpl --enable-nonfree --enable-postproc --enable-libx264 --enable-libaacplus
  libavutil      51. 72.100 / 51. 72.100
  libavcodec     54. 55.100 / 54. 55.100
  libavformat    54. 25.105 / 54. 25.105
  libavdevice    54.  2.100 / 54.  2.100
  libavfilter     3. 16.101 /  3. 16.101
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[mpegts @ 0x1876240] Could not find codec parameters for stream 1 (Video: mpeg2video ([2][0][0][0] / 0x0002)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[NULL @ 0x187abc0] start time is not set in estimate_timings_from_pts
Input #0, mpegts, from 'out2.ts':
  Duration: 00:00:00.08, start: 1.400000, bitrate: 1710 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: mpeg1video ([2][0][0][0] / 0x0002), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 104857 kb/s, 25 fps, 25 tbr, 90k tbn, 25 tbc
    Stream #0:1[0x101]: Video: mpeg2video ([2][0][0][0] / 0x0002), 90k tbr, 90k tbn, 90k tbc
At least one output file must be specified

Note that 1 stream is mpeg1video and another is mpeg2video. Maybe this is intended to work this way, but aren't we supposed to get 2 streams of the same codec used?

Change History (1)

comment:1 in reply to: ↑ description Changed 7 years ago by cehoyos

  • Resolution set to invalid
  • Status changed from new to closed

Replying to burek:

[mpegts @ 0xbb4d60] first pts value must set
av_interleaved_write_frame(): Invalid data found when processing input

This message implies that you have to use -fflags +genpts, the following command line works fine:
$ ffmpeg -i out1.mpg -fflags +genpts -ss 20 -i out1.mpg -map 0 -map 1 -c copy out2.ts

Note: See TracTickets for help on using tickets.