Opened 5 years ago

Closed 2 years ago

#12303 closed Bug Report - General (Works for me)

transcoding to Nuppelvideo loses audio

Reported by: ssd.mtv@… Owned by: JYA
Priority: major Milestone: unknown
Component: MythTV - Mythtranscode Version: 0.27-fixes
Severity: medium Keywords: transcode audio
Cc: Ticket locked: no

Description

This bug was fixed, but it is back now.

version fixes/0.2 (v0.27-1-g5b917e8) from the ubuntu nightly repositories.

If I transcode any video (using autodetect or otherwise) the resulting video has no audio left although there is an audio track in the output file. This seems to have started a couple of weeks ago, but I only noticed last night as there's only a few recordings I automatically transcode.

This is easily reproducible (at least for me). Let me know what data I need to collect if you can't reproduce this.

Change History (26)

comment:1 Changed 4 years ago by JYA

Status: newinfoneeded_new

version fixes/0.2 (v0.27-1-g5b917e8) from the ubuntu nightly repositories.

this version is ancient.

try with the latest from the mythbuntu nightly repo and report back

comment:2 Changed 4 years ago by amkroll@…

I can confirm this bug exists under my current mythbuntu installation fixes/0.27 [v0.27-193-g8ee257c] Which work correctly under .27.3 but then upon upgrade to .27.4 for SD changes, I lost all audio from and transcode settings

comment:3 Changed 4 years ago by J.Pilk@…

Is it lost or switched? Try NEXTAUDIO (default +) during playback. Stream info , eg from mythffmpeg -i <filename>, would be relevant.

comment:4 Changed 4 years ago by amkroll@…

output from mythffmpeg (apologies if I'm doing something wrong)

myth@mythtv:/mythStorage$ mythffmpeg -i 1061_20141111030000.nuv ffmpeg version 1.2.7 Copyright (c) 2000-2014 the FFmpeg developers

built on Oct 27 2014 06:14:12 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1) configuration: --compile-type=profile --prefix=/usr --runprefix=/usr --disable-mythlogserver --enable-crystalhd --enable-lirc --enable-audio-alsa --enable-audio-oss --enable-dvb --enable-ivtv --enable-firewire --enable-joystick-menu --with-bindings=perl --enable-ffmpeg-pthreads --enable-pic --perl-config-opts='INSTALLDIRS=vendor' --enable-libvpx --enable-sdl --enable-libmp3lame --enable-libx264 --enable-opengl-video --enable-vaapi --enable-vdpau libavutil 52. 18.100 / 52. 18.100 libavcodec 54. 92.100 / 54. 92.100 libavformat 54. 63.104 / 54. 63.104 libavdevice 54. 3.103 / 54. 3.103 libavfilter 3. 42.103 / 3. 42.103 libswscale 2. 2.100 / 2. 2.100 libswresample 0. 17.102 / 0. 17.102 libpostproc 52. 2.100 / 52. 2.100

[nuv @ 0x18dda20] max_analyze_duration 5000000 reached at 5005000 microseconds [nuv @ 0x18dda20] Estimating duration from bitrate, this may be inaccurate Guessed Channel Layout for Input Stream #0.1 : stereo Input #0, nuv, from '1061_20141111030000.nuv':

Duration: 00:46:23.01, start: 64864.952000, bitrate: 1411 kb/s

Stream #0:0: Video: mpeg4 (DIVX / 0x58564944), yuv420p, 720x416, SAR 416:405 DAR 16:9, 29.97 fps, 29.97 tbr, 1k tbn, 1k tbc Stream #0:1: Audio: pcm_s16le (RAWA / 0x41574152), 48000 Hz, stereo, s16, 1536 kb/s

At least one output file must be specified

comment:5 Changed 4 years ago by amkroll@…

Attempted to switch audio and only saw audio track 01, still with no audio. Playback data shows NONE for audio in the gui

comment:6 Changed 4 years ago by J.Pilk@…

OK, that shows what format you're using. I'm not familiar with it. What device/source?

I suppose that was the input file? Can you do the same for the output?

comment:7 Changed 4 years ago by Adam Kroll <amkroll@…>

my setup is a 1st gen HDHomerun Dual recording US broadcast ATSC recording on Mythbuntu 14.04

The output above is from my transcoded file. I can run the same command on a pre-transcoded file and get you the results later in the day.

I also have a section of my mythtranscode log that shows a bunch of errors if that would be helpful

comment:8 Changed 4 years ago by J.Pilk@…

I was just trying to establish the background to your problem. The info above shows an audio stream, as stated initially, but mythffmpeg seems to have problems with it. It might be worth trying another player if no-one comes up with an answer. Over and out, I'm afraid.

comment:9 Changed 4 years ago by ssd.mtv@…

I doubt that another player will help. The problem is that the transcoder is damaging the audio.

Something is wrong with the audio portion of the encoder. It emits a blank audio stream with nothing in it.

What would I need to do to help you debug this? I can record a 10 second clip or something and then give you before and after files from the encoding... Would that help?

Again, this is a repeat bug. It was fixed some time ago, and it has come back.

comment:10 Changed 4 years ago by J.Pilk@…

My last attempt to post here was rejected as probable spam. I suspect that mythtranscode is selecting the wrong audio track, and you should be able to check that with before and after runs of mythffmpeg -i <filename>. Continue on the users list.

comment:11 Changed 4 years ago by ssd.mtv@…

Before and after output from avconv... After generated with transcode -> autoprobe

The audio streams in before are nearly identical, the audio stream in after is silent.

before: avprobe version 9.16-6:9.16-0ubuntu0.14.04.1, Copyright (c) 2007-2014 the Libav developers

built on Aug 10 2014 18:16:02 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)

[mpegts @ 0x20942e0] PES packet size mismatch [mpegts @ 0x20942e0] PES packet size mismatch Input #0, mpegts, from 'before.mpg':

Duration: 00:00:20.72, start: 41410.995878, bitrate: 13722 kb/s Program 1

Stream #0.0[0x31]: Video: mpeg2video (Main), yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 24000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc Stream #0.1[0x34](eng): Audio: ac3, 48000 Hz, 5.1, fltp, 384 kb/s Stream #0.2[0x35](spa): Audio: ac3, 48000 Hz, mono, fltp, 192 kb/s

after: avprobe version 9.16-6:9.16-0ubuntu0.14.04.1, Copyright (c) 2007-2014 the Libav developers

built on Aug 10 2014 18:16:02 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)

[nuv @ 0xe9d2e0] Estimating duration from bitrate, this may be inaccurate Input #0, nuv, from 'after.nuv':

Duration: 00:07:29.03, start: 41411.301000, bitrate: 1411 kb/s

Stream #0.0: Video: nuv, yuv420p, 1920x1088, PAR 136:135 DAR 16:9, 29.97 fps, 29.97 tbr, 1k tbn Stream #0.1: Audio: mp3, 48000 Hz, 2 channels, s16p, 1411 kb/s

Would it help to have the two files? 34M before.mpg 76M after.nuv

comment:12 Changed 4 years ago by ssd.mtv@…

I tried to copy the audio out of the videos and this is what I get from after:

Input #0, nuv, from 'after.nuv':

Duration: 00:07:29.03, start: 41411.301000, bitrate: 1411 kb/s

Stream #0.0: Video: nuv, yuv420p, 1920x1088, PAR 136:135 DAR 16:9, 29.97 fps, 29.97 tbr, 1k tbn Stream #0.1: Audio: mp3, 48000 Hz, stereo, s16p, 1411 kb/s

Output #0, mp3, to 'after.mp3':

Metadata:

TSSE : Lavf54.20.4 Stream #0.0: Audio: libmp3lame, 48000 Hz, stereo, 1411 kb/s

Stream mapping:

Stream #0:1 -> #0:0 (copy)

Press ctrl-c to stop encoding size= 0kB time=10000000000.00 bitrate= 0.0kbits/s video:0kB audio:0kB global headers:0kB muxing overhead inf%

I think it is safe to say that mythtranscode is not merely selecting the wrong audio track, but actually creating new empty track.

The audio tracks from before extract as: 948K before1.ac3 1.1M before2.ac3

comment:13 Changed 4 years ago by John Pilkington <J.Pilk@…>

Trying again to get this response onto the ticket...

You asked: Would it help to have the two files? 34M before.mpg 76M after.nuv

It won't do any harm to put them in a drop-box somewhere, and might reveal something.

... but isn't this about compression?

comment:14 Changed 4 years ago by Karl Egly

Is it on purpose that you transcode (convert to MPEG4+MP3 in NUV) instead of cutting lossless (keeping the MPEG2+AC3 intact)? Seeing that the file gets bigger the re-encoding doesn't seem to be worth it. You can try by using the --mpeg2 command line option or add a lossless transcoding profile in mythtv-setup.

comment:15 Changed 4 years ago by John Pilkington <J.Pilk@…>

Agreed: for that input format mythtranscode --mpeg2 is the appropriate tool.

comment:16 Changed 4 years ago by ssd.mtv@…

Is it on purpose that you transcode (convert to MPEG4+MP3 in NUV) instead of cutting lossless (keeping the MPEG2+AC3 intact)? Seeing that the file gets bigger the re-encoding doesn't seem to be worth it.

Ya, noticed that after I posted it. To make debugging simpler, I chose the "autodetect" method. Normally when I transcode, I would pick a custom method that would also reduce resolution.

I'll look and see if I can figure out where to add the --mpeg2 option if it isn't already there. Either way, the resulting video has no audio in its single audio track, which kinda kills any desire for me to do any transcoding at all. I've also stopped transcoding to effect edits, which is annoying.

comment:17 Changed 4 years ago by John Pilkington <J.Pilk@…>

You probably didn't see this 'branch' of this thread. Why are you trying to transcode? Save space, display on another device? ... But this is really a users-list topic at present.

http://www.gossamer-threads.com/lists/mythtv/dev/579753#579753

comment:18 Changed 4 years ago by ssd.mtv@…

Why am I trying to transcode? All of the above really. All of these, but not always at the same time.

1) To make edits permanent 2) To reduce space use 3) To reduce network bandwidth 4) To reduce resolution to make the job of an old device easier

comment:19 Changed 4 years ago by John Pilkington <J.Pilk@…>

ok. I thought mythtranscode --mpeg2 --honorcutlist was supposed to work, within the myth framework. I haven't used it recently but I don't think it offers resolution downsizing. Disk space is getting cheaper and downsizing is computationally expensive (ie slow), so dev interest isn't high. The documentation for replex speaks of DVDs, and the higher bitrate of HD might be causing your problem,

Maybe, if you can't record at lower resolution, you should try

mythffmpeg -v "verbose" -i "infile.mpg" -target ntsc-dvd "outfile.mpg"

for a start. There is a very long set of options.

comment:20 Changed 4 years ago by ssd.mtv@…

Well, that mythffmpeg line doesn't really do any thing I want. Reducing to NTSC is certainly not what I want, and copying a specific input file to a specific output file is not what I want -- if I wanted that, I'd just run avconv by hand in the video directory.

And it appears that mythtranscode doesn't do what I want either. (I.e., reduce videos without destroying their audio or even make them smaller.)

Would it be possible to just replace mythtranscode with mythffmpeg in mythtv-setup ? What would the syntax to do that be? This all seems extremely poorly documented.

I can't even replace mythtranscode with mythtranscode in mythtv-setup, as the "default" adds all kinds of undocumented command line parameters that change from version to version and are not automatically added if I just drop a new command into the transcoder blank in mythtv setup.

comment:21 Changed 4 years ago by John Pilkington <J.Pilk@…>

The essence of your complaint seems to be 'it doesn't work.' The ntsc suggestion was intended to give you a starting point that probably would.

Since it appears that you are dealing with an mpeg2 input: in mythtvsetup > recording profiles > transcoders > autodetect from MPEG2 > Lossless transcoding > finish. That should do cutting but not resizing or change of format. It has sometimes given trouble when the stream count changes.

I don't remember ever using the resizing options, which I believe convert to the .nuv format. That has been supported in myth for a long time but is otherwise rare. One apparently satisfied user here has urged its retention. I suggest that if you wish to experiment you do it with short recordings.

There are several scripts on the wiki. If you find something better, let us know.

comment:22 Changed 4 years ago by ssd.mtv@…

It would be nice of some of the external scripts could be integrated into core mythtv as menu options, even if only as examples.

I've looked at a lot of those scripts, and it is confusing which ones would work with current mythtv versions, as none of them are on the official mythtv website and the ones in the wiki look very out of date.

It isn't even clear what command line parameters should be sent to them, or even the ones the default scripts use -- there is no example even for the default setup.

I think the problem here is as much a documentation issue as it is missing functionality or broken mythtranscode. Replacing mythtranscode itself is poorly documented.

comment:23 Changed 4 years ago by Karl Egly

Summary: mythtranscode destroys audiotranscoding to Nuppelvideo loses audio

comment:24 Changed 4 years ago by Nicolas Pöhlmann <nicolas.poehlmann@…>

Replying to dekarl: it seems to be an error when transcoding 5.1 audio channels to mp3-format, at least wrong frame size is selected for audio.

before [cut down to necessary information]: ffprobe version 1.2.7 Copyright (c) 2007-2014 the FFmpeg developers ... Input #0, mpegts, from '/media/MythTV_Disk2/MythTV/Standard/13120_20150221191000.mpg':

Duration: 01:04:58.66, start: 90506.666933, bitrate: 6079 kb/s

Stream #0:0[0x1a05]: Video: h264 (High), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 100 tbc Stream #0:1[0x1a06](deu): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s Stream #0:2[0x1a07](fra): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s Stream #0:3[0x1a08](ger): Subtitle: dvb_teletext Stream #0:4[0x1a09](deu): Subtitle: dvb_subtitle Stream #0:5[0x1a0a](fra): Subtitle: dvb_subtitle

Unsupported codec with id 94215 for input stream 3 [dvbsub @ 0x1aae8c0] Invalid extradata, subtitle streams may be combined! [dvbsub @ 0x1aaf440] Invalid extradata, subtitle streams may be combined!

after [cut down to necessary information]: ffprobe version 1.2.7 Copyright (c) 2007-2014 the FFmpeg developers ... [nuv @ 0x1febea0] max_analyze_duration 5000000 reached at 5000000 microseconds [nuv @ 0x1febea0] Could not find codec parameters for stream 1 (Audio: mp3 (LAME / 0x454D414C), 48000 Hz, 2 channels, s16p, 1411 kb/s): unspecified frame size Consider increasing the value for the 'analyzeduration' and 'probesize' options [nuv @ 0x1febea0] Estimating duration from bitrate, this may be inaccurate Input #0, nuv, from '/media/MythTV_Disk2/MythTV/Standard/13120_20150221191000.nuv':

Duration: 04:50:57.46, start: 0.020000, bitrate: 1411 kb/s

Stream #0:0: Video: mpeg4 (DIVX / 0x58564944), yuv420p, 1280x720, SAR 1:1 DAR 16:9, 50 fps, 50 tbr, 1k tbn, 1k tbc Stream #0:1: Audio: mp3 (LAME / 0x454D414C), 48000 Hz, 2 channels, s16p, 1411 kb/s

But this time it's NOT a similar problem like in #11639. it only affects 5.1/x.1 channel transcoding. stereo recordings are NOT affected.

PROBLEM: The AudioReencodeBuffer? frames in the transcode.cpp file [Line 286 and 1338] aren't filled, so that no audio frames at all can be even processed. I assume that there must be a problem filling them while trying to down 5.1 channels to 2.

As I'm not an audio/lame expert, maybe another one can take a look into that problem.

Better solution would be if there is someone out which can implement an option for the mp3-surround extension: http://en.wikipedia.org/wiki/MP3_Surround

comment:25 Changed 3 years ago by paulh

Status: infoneeded_newnew

comment:26 Changed 2 years ago by JYA

Resolution: Works for me
Status: newclosed

works for me here

Note: See TracTickets for help on using tickets.