[FFmpeg-user] FFmpeg looses audio sync on broken TS files... mencoder not ; -(

Toerless Eckert tte at cs.fau.de
Thu Dec 8 07:11:27 EET 2016

[resending with attachment zipped and stripped to pass the the mailing list size gate]

(Still) Trying to encode TS files generated from linux DVB receiver app.
Alas, sometimes, the app has the problem of skipping some randomn blocks
of data due do buffer overflow - or during rain, LNB SNR goes so much down
that blocks do not get decoded correctly.

Example recording had errors between ca. 8..11 min into the recording.
When playing back after the 11 min mark (when everything is fine again):

- Original (MPEG2) TS from DVB receiver app plays fine

- Encoded (H.264/MP3) with ffmpeg in TS container plays back fine

- Encoded (H.264/MP3) with ffmpeg in AVI container plays back without AVsync:
  eg: at 11 min mark you hear audio already from 12 min mark. And during
  the broken segment (8..11 min), you hear less stopping of audio, eg:
  it goes on continuously - which explains why it's off.
- Encoded (H.264/MP3) with mplayer in AVI container plays back fine!

- Encoded (H.264/MP3) with ffmpeg in MKV container plays back fine
  ... but the file seems to have insufficient/missing indices, eg:
  Kodi can't skip forward into the file (works fine with ffmpeg encodings
  from non-broken TS files).
- Encoded (H.264/MP3) with mplayer in MKV container plays back fine!
  (and skipping in file as well).

I tried the little options for changing sync behavior i thought i understand,
but it didn't help:
    - (none)
    - -map 0:0,0:0 -map 0:1,0:0
       (0:0 is video, 0:1 audio, aka: trying to sync audio from video)
    - -map 0:0,0:1 -map 0:1,0:1

Any ideas what i could try to do in terms of eg: magic ffmpeg options to make
this work in ffmpeg ? Of course, it would be great if it would work in
ffmpeg without magic options - like it does in mplayer.

Attached example of three .avi encodings with ffmpeg, mencoder and the
.TS encoding - followed by the console output of the commands.

I don't know how i could provide reasonable useful broken input or
output files - the input file is 2GB large, the output files also
a couple hundred MBs. Not sure if any small cut would help (and if
curring wouldn't change the result).


-------------- next part --------------
A non-text attachment was scrubbed...
Name: console-output.txt.bz2
Type: application/octet-stream
Size: 183129 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20161208/e38a9b1f/attachment.obj>

More information about the ffmpeg-user mailing list