Avidemux Forum

Avidemux => Main version 2.6 => Topic started by: muxterious on December 11, 2016, 12:54:07 AM

Title: Possible regression: "missing" audio track after copy-only edit of ts -> ts
Post by: muxterious on December 11, 2016, 12:54:07 AM
I previously used 2.6.12 to edit many TV recordings.  Now, after upgrading to 2.6.15, the same exact procedure results in .ts files that both my TV and avidemux3, itself, think are lacking audio.  However, when I play them with mplayer, the audio seems to be there.  I compiled (and run) both releases on the same Ubuntu 16.04 machine.

I also tried gstreamer's decodebin, which can see the audio in 2.6.12 files but not 2.6.15.

First, is this a known problem?  If not is there any MPEG-TS tool I can use to analyze the resulting streams and figure out what's different?

Second, how can I "fix" the files edited with 2.6.15?  I no longer have the source material, so I'd like to remux them to recover the audio.

Thanks.
Title: Re: Possible regression: "missing" audio track after copy-only edit of ts -> ts
Post by: muxterious on December 11, 2016, 01:05:55 AM
BTW, it seems I was able to "fix" the bad files using:
ffmpeg -i broken.ts -c copy fixed.ts
Title: Re: Possible regression: "missing" audio track after copy-only edit of ts -> ts
Post by: mean on December 11, 2016, 06:13:27 AM
Please provide a short sample of those source videos
5 or 10 seconds is enough

Title: Re: Possible regression: "missing" audio track after copy-only edit of ts -> ts
Post by: Jan Gruuthuse on December 11, 2016, 08:09:42 AM
Quote from: muxterious on December 11, 2016, 12:54:07 AM
>8 >8 I compiled (and run) both releases on the same Ubuntu 16.04 machine. >8>8
If you have 64-bit ubuntu, do you have the same issue with this build? Qt 5 and CLI version 16.04.1 Ubuntu LTS 64-Bit only (http://avidemux.org/smif/index.php/topic,17276.0.html)
Title: Re: Possible regression: "missing" audio track after copy-only edit of ts -> ts
Post by: muxterious on December 12, 2016, 03:09:26 PM
Quote from: mean on December 11, 2016, 06:13:27 AMPlease provide a short sample of those source videos
5 or 10 seconds is enough
Where should I put it?  It's too big to attach.
Title: Re: Possible regression: "missing" audio track after copy-only edit of ts -> ts
Post by: muxterious on December 12, 2016, 03:24:47 PM
Quote from: Jan Gruuthuse on December 11, 2016, 08:09:42 AM
Quote from: muxterious on December 11, 2016, 12:54:07 AM
>8 >8 I compiled (and run) both releases on the same Ubuntu 16.04 machine. >8>8
If you have 64-bit ubuntu, do you have the same issue with this build? Qt 5 and CLI version 16.04.1 Ubuntu LTS 64-Bit only (http://avidemux.org/smif/index.php/topic,17276.0.html)
Thanks.  I tried avidemux 2.6.15 161212-64bit Xenial with x265 version 1.9, but it's no better.  The file it saves is "bad" and when it loads the "bad" file it appears to have no audio.  It's also rejected by GStreamer and my TV, though all 3 like the original.

BTW, the original was cut with 2.6.12.
Title: Re: Possible regression: "missing" audio track after copy-only edit of ts -> ts
Post by: muxterious on December 12, 2016, 03:29:28 PM
BTW, the GStreamer commandline I'm using is:
gst-launch-1.0 filesrc location=File.ts ! decodebin ! audioconvert ! alsasink

For good files, I hear the audio.  For bad files, the pipeline won't link because the demuxer doesn't see the audio stream and therefore creates no audio pad:Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
WARNING: from element /GstPipeline:pipeline0/GstDecodeBin:decodebin0: Delayed linking failed.
Additional debug info:
./grammar.y(506): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstDecodeBin:decodebin0:
failed delayed linking some pad of GstDecodeBin named decodebin0 to some pad of GstAudioConvert named audioconvert0
Redistribute latency...
ERROR: from element /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTSDemux:tsdemux0: Internal data stream error.
Additional debug info:
mpegtsbase.c(1388): mpegts_base_loop (): /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTSDemux:tsdemux0:
stream stopped, reason not-linked
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
Title: Re: Possible regression: "missing" audio track after copy-only edit of ts -> ts
Post by: Jan Gruuthuse on December 12, 2016, 03:35:06 PM
Quote from: muxterious on December 12, 2016, 03:09:26 PM
Quote from: mean on December 11, 2016, 06:13:27 AMPlease provide a short sample of those source videos
5 or 10 seconds is enough
Where should I put it?  It's too big to attach.

Upload
Use a free dropbox account, https://www.wetransfer.com/, mega or similar webservice (free public access, without registration to download your uploaded video) thank you.
Title: Re: Possible regression: "missing" audio track after copy-only edit of ts -> ts
Post by: muxterious on December 12, 2016, 03:56:15 PM
Sent PM with link.  Let me know if you have any issues with it.
Title: Re: Possible regression: "missing" audio track after copy-only edit of ts -> ts
Post by: Jan Gruuthuse on December 12, 2016, 05:01:28 PM
Playing the video sample provided, E-AC3 3F2M/LFE audio starts in avidemux @ 1.8 seconds, while in vlc it is not delayed.
Title: Re: Possible regression: "missing" audio track after copy-only edit of ts -> ts
Post by: mean on December 12, 2016, 05:47:34 PM
There is only one audio track
???
Title: Re: Possible regression: "missing" audio track after copy-only edit of ts -> ts
Post by: muxterious on December 12, 2016, 10:58:28 PM
Quote from: Jan Gruuthuse on December 12, 2016, 05:01:28 PM
Playing the video sample provided, E-AC3 3F2M/LFE audio starts in avidemux @ 1.8 seconds, while in vlc it is not delayed.
Yes, I also noticed this.

GStreamer also plays it without delay, when decoding just the audio (see above), leading me to assume it might've been some sort of timestamp/synchroniztion issue.
Title: Re: Possible regression: "missing" audio track after copy-only edit of ts -> ts
Post by: muxterious on December 12, 2016, 11:00:48 PM
Quote from: mean on December 12, 2016, 05:47:34 PM
There is only one audio track
???
Yes, as far as I know.  These clips are recorded off broadcast TV, where SAP seems to be fairly uncommon (at least, for what I record).
Title: Re: Possible regression: "missing" audio track after copy-only edit of ts -> ts
Post by: muxterious on December 12, 2016, 11:02:58 PM
Could you both reproduce the problem?
Title: Re: Possible regression: "missing" audio track after copy-only edit of ts -> ts
Post by: mean on December 13, 2016, 05:53:42 AM
Yes
It's the delay, i.e. the end result has no audio for a bit at the beginning and so avidemux bails, not finding it
I'll increase the search radius

If you chop off the beginning (a couple of seconds), it works
Title: Re: Possible regression: "missing" audio track after copy-only edit of ts -> ts
Post by: mean on December 13, 2016, 06:52:05 AM
Done
Title: Re: Possible regression: "missing" audio track after copy-only edit of ts -> ts
Post by: Jan Gruuthuse on December 13, 2016, 07:26:51 AM
@muxterious
-  avidemux Cli/Qt5 2.6.15 64-bit deb download ubuntu 16.04.1 LTS (http://avidemux.org/smif/index.php/topic,17276.0.html) <-corrected url
- do check/adjust for audio sync delay, if any.
Title: Re: Possible regression: "missing" audio track after copy-only edit of ts -> ts
Post by: muxterious on December 13, 2016, 12:07:31 PM
Quote from: mean on December 13, 2016, 05:53:42 AM
Yes
It's the delay, i.e. the end result has no audio for a bit at the beginning and so avidemux bails, not finding it
I'll increase the search radius

If you chop off the beginning (a couple of seconds), it works
With respect, I don't see how that's the only issue.

Granted, this was edited twice, both times with 2.6.12.  Yet, it still has audio (yes, delayed onset, but not missing or out of sync).  However, if I do any edit with 2.6.15, the result has an audio track that can't be seen by my TV, GStreamer, or any 2.6 build I've tried.  If you only fix 2.6.15's ability to detect the audio in a poorly packetized stream (is that the issue?) but don't fix the way files are written, then I still can't hear audio when streaming them to my TV.

BTW, I'm streaming them with minidlna.  So, it's possible minidlna is really the one who can't see the audio.
Title: Re: Possible regression: "missing" audio track after copy-only edit of ts -> ts
Post by: muxterious on December 13, 2016, 12:42:18 PM
Quote from: Jan Gruuthuse on December 13, 2016, 07:26:51 AM
@muxterious
-  avidemux Cli/Qt5 2.6.15 64-bit deb download ubuntu 16.04.1 LTS (http://avidemuxcli/Qt52.6.1564-bitdebdownloadubuntu16.04.1LTS%3Cbr/%3Ehttp://avidemux.org/smif/index.php/topic,17276.0.html)
- do check/adjust for audio sync delay, if any.
Okay, I tried it (well, that link seems broken but I tried the latest build) and it sees the audio in the "bad" files.  The initial gap is still there, too.

However, my primary issue is still unresolved - it still creates "bad" files.
Title: Re: Possible regression: "missing" audio track after copy-only edit of ts -> ts
Post by: mean on December 13, 2016, 01:16:42 PM
Workaround :
Either cut the beginning of the file or re-encode audio
Title: Re: Possible regression: "missing" audio track after copy-only edit of ts -> ts
Post by: muxterious on December 13, 2016, 02:07:10 PM
Quote from: mean on December 13, 2016, 01:16:42 PM
Workaround :
Either cut the beginning of the file or re-encode audio
Okay, thanks for looking into it.

Also, thanks for your work on avidemux.  It has filled a hole in my life left by virtualdub, and it does more!