[MEncoder-users] Out of sync audio after 'cleaning' a TS stream

Richard Lemieux rlemieu at cooptel.qc.ca
Sun Apr 6 17:27:04 CEST 2014


Thanks Carl,

"ts do not have an index". I am referring to the 'time' displayed in mplayer 
when pressing the 'o' key.  It seems that there is a 'time' stamp running with 
the TS stream.  However this time is relative to a program and not to the 
beginning of the TS file.  I just found that using the '-forceidx' in mencoder 
will replace the TS time with another time that is relative to the start of the 
file (instead of being the TS time stamp).

The reason I 'reindexed' is that I just wanted mplayer to display the time from 
the start of the file rather than the TS time stamp.  The reason is that I use a 
script to extract fragments of the longer TS stream using an ffmpeg script and I 
need to give values to -ss and -t parameters.

"you are writing an avi".  After reading your reply I checked and you are 
right.  The output container format is AVI and not TS as I expected.  My copy of 
'mencoder' does not have TS as an available output format.

"MEncoder is not an actively maintained application".  I didn't know.  I wrote a 
new script using ffmpeg to extract the fragments directly from the original TS 
file.  I get the time using 'avidemux2_qt4' since I can't get the times from 
mplayer.  That worked fine so far but I didn't get badly damaged TS files lately 
so it remains to be seen what will happen with a damaged TS input stream (with 
many missing / incomplete frames).  Here my newer command,

     ss=$((($1*60+$2)*60+$3)); # hour ($1), min ($2), sec ($3) Start time
     se=$((($4*60+$5)*60+$6)); # hour ($4), min ($5), sec ($6)  End time
     ffmpeg -i in.ts -c:v libx264 -crf 22 -c:a libfaac -ss ${ss} -t $(($se-$ss)) 
out.mp4


"I don't see how you can make them "cleaner".  I found out that mencoder with 
the '-lavdopts er=4' options would just skip the damaged parts of the input TS 
stream when writing the output file, while still maintaining audio in sync.  So 
at the next step when extracting fragments from the 'cleaned' file, I would get 
'clean' fragments with the damaged frames removed.

Richard

On 04/02/2014 08:16 PM, Carl Eugen Hoyos wrote:
> Richard Lemieux <rlemieu <at> cooptel.qc.ca> writes:
>
>> mencoder -forceidx -lavdopts er=4 f1.ts -oac copy
>> -ovc copy -o fi_cleaned.ts
> This looks slightly broken:
> -ovc copy avoids the decoder, so the decoder options
> are ignored.
> I wanted to write: ts do not have an index, but I
> have a suspicion you are writing an avi file and
> call it "ts", is that right?
>
> Since you apparently don't know:
> MEncoder is not an actively maintained application for
> several years, you should try to use current FFmpeg
> instead, but in your specific case, I strongly
> suggest not to touch the transport streams (as long
> as you don't want to reencode), I don't see how you
> can make them "cleaner"...
>
> Carl Eugen
>
> _______________________________________________
> MEncoder-users mailing list
> MEncoder-users at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
>
>



More information about the MEncoder-users mailing list