Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#5808 closed defect (worksforme)

-c copy -f hls fails while -c copy -f mpegts succeeds

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

Description

Tried on FFmpeg git

This fails

/usr/local/bin/ffmpeg -y -i sample.ts -c copy -f hls output.m3u8

with debug

Input #0, mpegts, from 'sample.ts':
  Duration: 00:01:20.74, start: 39977.599900, bitrate: 8628 kb/s
  Program 55271
    Metadata:
      service_name    : &tv HD
      service_provider: AAAA
    Stream #0:0[0x901]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x902](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 128 kb/s
    Stream #0:2[0x904](eng,eng,und): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Stream #0:3[0x903](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 224 kb/s
[hls @ 0x2c14a20] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
    Last message repeated 2 times
[webvtt @ 0x2be6c00] Exactly one WebVTT stream is needed.
Output #0, hls, to 'output.m3u8':
  Metadata:
    encoder         : Lavf57.48.100
    Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 50 tbr, 50 tbn, 50 tbc
    Stream #0:1(eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, 128 kb/s
    Stream #0:2(eng,eng,und): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
  Stream #0:2 -> #0:2 (copy)
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument

Whilst this works:

/usr/local/bin/ffmpeg -y -i sample.ts -c copy -f mpegts output.ts

with debug

Input #0, mpegts, from 'sample.ts':
  Duration: 00:01:20.74, start: 39977.599900, bitrate: 8628 kb/s
  Program 55271
    Metadata:
      service_name    : &tv HD
      service_provider: AAAA
    Stream #0:0[0x901]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x902](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 128 kb/s
    Stream #0:2[0x904](eng,eng,und): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Stream #0:3[0x903](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 224 kb/s
[mpegts @ 0x37b4a20] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
    Last message repeated 1 times
Output #0, mpegts, to 'output.ts':
  Metadata:
    encoder         : Lavf57.48.100
    Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 50 tbr, 90k tbn, 90k tbc
    Stream #0:1(eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mpegts @ 0x370a3e0] PES packet size mismatch
frame= 3915 fps=0.0 q=-1.0 Lsize=   83015kB time=00:01:20.53 bitrate=8444.1kbits/s speed= 493x
video:75693kB audio:1237kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 7.909218%

I am not sure why ffmpeg wants to copy the subtitle stream when its "-f hls" and not when its "-f mpegts".
Also, I am not sure what "[webvtt @ 0x2d83e60] Exactly one WebVTT stream is needed." means.

Change History (5)

comment:1 by barhom, 8 years ago

Sample can be downloaded from:

https://www.netsat.se/temp/sample.ts

comment:2 by Carl Eugen Hoyos, 8 years ago

Resolution: worksforme
Status: newclosed

Works for example with -sn or -map 0:0 -map 0:1.

in reply to:  2 comment:3 by barhom, 8 years ago

Resolution: worksforme
Status: closedreopened

Replying to cehoyos:

Works for example with -sn or -map 0:0 -map 0:1.

You are right that it works when using "-map" or "-sn" but that is not the point.
The point is that there seems to be two different "defaults" of which streams ffmpeg is choosing.

I dont know if it is by design that it picks video,audio,subtitle when you are outputting "-f hls" while if you do "-f mpegts" it chooses only video,audio.

Would appreciate if somebody can shed some light into this.

comment:4 by Carl Eugen Hoyos, 8 years ago

Resolution: worksforme
Status: reopenedclosed

Yes, two different formats (can) have two different defaults.

comment:5 by barhom, 8 years ago

Alright thanks, I guess this is by design then.

Thank you.

Note: See TracTickets for help on using tickets.