Question about using Webm/Matroska container in audio transconding

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about using Webm/Matroska container in audio transconding

Ivan Zderadicka
Hi,

I'm using ffmpeg for transcoding of audio (audio book chapters) into
Opus stream that is then being sent to client.

I'm using Ogg container and Webm or Matroska container for resulting audio.

To convert to Opus I use following command (here is pipe going to test
file, normally is pipe consumed and send to socket):

ffmpeg -i kapitola.mp3 -y -map-metadata 0 -map a -acodec libopus -vbr on
-b:a 24k -compression_level 6 -cutoff 12000 -f opus pipe:1 > test1.opus

Same for Webm container:

ffmpeg -i kapitola.mp3 -y -map-metadata 0 -map a -acodec libopus -vbr on
-b:a 24k -compression_level 6 -cutoff 12000 -f webm pipe:1 > test1.webm


Now Webm result  does not contain duration of audio stream (while in
case of Ogg container correct duration is there), which basically means
that result is not
seekable in client player.

If output of ffmpeg is a local file, not pipe, then duration is present.
So I assume in case of Webm duration is added to file later ( same issue
also for Matroska container).

Now my question is -  is there any workaround for this, am I missing
something in arguments? Or is it intrinsic to Webm/Matroska container
and nothing can be done about it, when output is pipe?
Why it works for Ogg and not for Webm?

Thanks
Ivan


_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Question about using Webm/Matroska container in audio transconding

Carl Eugen Hoyos-2
2018-12-11 15:13 GMT+01:00, Ivan Zderadicka <[hidden email]>:

> ffmpeg -i kapitola.mp3 -y -map-metadata 0 -map a -acodec libopus -vbr on
> -b:a 24k -compression_level 6 -cutoff 12000 -f webm pipe:1 > test1.webm

(Complete, uncut console output missing.)

If you use pipe output, it is impossible to update the file header
information with the actual file duration.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Question about using Webm/Matroska container in audio transconding

Ivan Zderadicka
Thanks,
just curious why it then works with ogg container and not in webm. What's  reason that header must be updated afterwards?
I.

On 11 December 2018 15:31:44 CET, Carl Eugen Hoyos <[hidden email]> wrote:

>2018-12-11 15:13 GMT+01:00, Ivan Zderadicka
><[hidden email]>:
>
>> ffmpeg -i kapitola.mp3 -y -map-metadata 0 -map a -acodec libopus -vbr
>on
>> -b:a 24k -compression_level 6 -cutoff 12000 -f webm pipe:1 >
>test1.webm
>
>(Complete, uncut console output missing.)
>
>If you use pipe output, it is impossible to update the file header
>information with the actual file duration.
>
>Carl Eugen
>_______________________________________________
>ffmpeg-user mailing list
>[hidden email]
>http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
>To unsubscribe, visit link above, or email
>[hidden email] with subject "unsubscribe".

--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Question about using Webm/Matroska container in audio transconding

Carl Eugen Hoyos-2
2018-12-11 18:26 GMT+01:00, Ivan <[hidden email]>:

> just curious why it then works with ogg container and not in webm.

I am not convinced it works, would need console output.

> What's reason that header must be updated afterwards?

Duration is only known at the end of transcoding.

Please do not top-post here, Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Question about using Webm/Matroska container in audio transconding

Ivan Zderadicka

On 11/12/18 18:41, Carl Eugen Hoyos wrote:
> 2018-12-11 18:26 GMT+01:00, Ivan <[hidden email]>:
>
>> just curious why it then works with ogg container and not in webm.
> I am not convinced it works, would need console output.
Please see attached listing of console session - console_output.txt -  
file with ogg container does have duration, file with webm does not (as
can be seen in ffprobe listing), but both are created through pipe.
> Please do not top-post here, Carl Eugen
Sorry did not realize it would be issue.
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".


_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

console_output.txt (22K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Question about using Webm/Matroska container in audio transconding

Moritz Barsnick
On Wed, Dec 12, 2018 at 08:30:27 +0100, Ivan Zderadicka wrote:

> ivan@ivan-ThinkPad-T460:~/tmp$ ffprobe test1.webm
[...]
> Input #0, matroska,webm, from 'test1.webm':
>   Metadata:
>     title           : 10.kapitola
>     encoder         : Lavf56.40.101
>   Duration: N/A, start: 0.007000, bitrate: N/A
>     Stream #0:0: Audio: opus, 48000 Hz, stereo, fltp (default)

I get:
$ ffmpeg -i test_time.webm
[...]
Input #0, matroska,webm, from 'test_time.webm':
  Metadata:
    ENCODER         : Lavf58.23.102
  Duration: 00:00:05.00, start: -0.007000, bitrate: 27 kb/s
    Stream #0:0: Audio: opus, 48000 Hz, mono, fltp (default)
    Metadata:
      ENCODER         : Lavc58.41.101 libopus

My suggestion:

> ffmpeg version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg developers
>   built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609

Your version of ffmpeg is ancient. Your issue may have long been
solved. Please get hold of a recent version of ffmpeg. If you can't
find a Ubunuto repository which provides latest builds, grab a binary
from here:

https://johnvansickle.com/ffmpeg/

(Preferred: Left column, git builds - not the releases.)

I have no idea whether the file creation or the interpretation of the
created file is different in recent ffmpeg (I assume the former), but
it just works with webm.

Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Question about using Webm/Matroska container in audio transconding

Carl Eugen Hoyos-2
In reply to this post by Ivan Zderadicka
2018-12-12 8:30 GMT+01:00, Ivan Zderadicka <[hidden email]>:
>
> On 11/12/18 18:41, Carl Eugen Hoyos wrote:
>> 2018-12-11 18:26 GMT+01:00, Ivan <[hidden email]>:
>>
>>> just curious why it then works with ogg container and not in webm.

The formats are different, you need to seek back to write the
matroska duration, see line 2591 (and 2638 in the same block) in
current libavformat/matroskaenc.c, this is not a limitation of FFmpeg.

>> I am not convinced it works, would need console output.
>
> Please see attached listing of console session - console_output.txt -
> file with ogg container does have duration, file with webm does not (as
> can be seen in ffprobe listing), but both are created through pipe.

The ogg format apparently allows for this feature, note that the
format has so many issues that it cannot be seriously recommended.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Question about using Webm/Matroska container in audio transconding

Ivan Zderadicka



>The ogg format apparently allows for this feature, note that the
>format has so many issues that it cannot be seriously recommended.
>

Just to be sure I understand you say ogg container is not good, right? Can you bit elaborate what is the problem if I'm using it for audio only media? I have been using it (opus+ogg) for couple of years and have not met any significant problems.

Thanks
Ivan
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Question about using Webm/Matroska container in audio transconding

Carl Eugen Hoyos-2
2018-12-12 16:52 GMT+01:00, Ivan <[hidden email]>:

>>The ogg format apparently allows for this feature, note that the
>>format has so many issues that it cannot be seriously recommended.
>
> Just to be sure I understand you say ogg container is not good, right? Can
> you bit elaborate what is the problem if I'm using it for audio only media?

There may be no problem for you, most people who implemented support
were not happy with it and the fact that it needs special (from development-
side) for every single codec seems like a big disadvantage.

> I have been using it (opus+ogg) for couple of years and have not met any
> significant problems.

"Never change a running system."
;-)

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".