0

I am recording from my Linux TV-Sat receiver in MPEG-2 transport stream (mpeg2video) format. The recording starts before the actual movie, so it usually only has a single (local) audio stream in the beginning, which is correctly detected by ffmpeg or mediainfo:

Input #0, mpegts, from '20131112 2012 - Sky Cinema - Django Unchained.ts':
  Duration: 02:43:02.20, start: 5841.428544, bitrate: 3898 kb/s
  Program 8 
  Program 9 
  Program 10 
    Stream #0:0[0x20](deu): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Stream #0:1[0x1ff]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:2[0x200](deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s (clean effects)
  Program 11 
  Program 20 
  Program 43 
  Program 251 
  Program 261 
  Program 3499 
  Program 3500 
  Program 3847 
  Program 4021 
  Program 4022 
  Program 4024 

Note the value for 'start' is taken from the recording itself when no explicit start value was given to ffmpeg by means of -ss or (a)trim=.

However, after some time, a second (eg english) audio stream is coming along, and it can well be used in the conversion from .ts to .mp4 (for example):

Input #0, mpegts, from '20131112 2012 - Sky Cinema - Django Unchained.ts':
  Duration: 02:43:02.20, start: 5841.428544, bitrate: 3898 kb/s
  Program 8 
  Program 9 
  Program 10 
    Stream #0:0[0x20](deu): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Stream #0:1[0x1ff]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:2[0x200](deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s (clean effects)
    Stream #0:3[0x201](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, 192 kb/s (clean effects)
    Stream #0:4[0x203](deu): Audio: ac3 ([6][0][0][0] / 0x0006), 0 channels (clean effects)
  Program 11 
  Program 20 
  Program 43 
  Program 251 
  Program 261 
  Program 3499 
  Program 3500 
  Program 3847 
  Program 4021 
  Program 4022 
  Program 4024 
Stream mapping:
  Stream #0:1 (mpeg2video) -> trim
  Stream #0:2 (mp2) -> atrim
  Stream #0:3 (mp2) -> atrim
  setpts -> Stream #0:0 (libx264)
  asetpts -> Stream #0:1 (aac)
  asetpts -> Stream #0:2 (aac)
Press [q] to stop, [?] for help

(Note: here a value for 'start' was passed to ffmpeg; the value was manually derived and supplied after looking at the recorded .ts file)

Is there a way to detect audio stream(s) without supplying any 'start' value?

2
  • a value for 'start' was passed to ffmpeg --> what does this mean? – Gyan Apr 13 at 3:53
  • Sorry, I was typing too quick. I wanted to say that in the second example, I am using "-ss nnn" as prefix to the input (-i) and/or use (a)trim= in the complex filter to "position" the transcoding process to the beginning of the actual movie within the recording, say after 1 or 2 minutes. – THN Apr 13 at 7:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.