Discussion:
[FFmpeg-user] Opus : difference between .opus and .ogg file extension
n***@free.fr
2017-11-30 10:24:43 UTC
Permalink
Hello all,
ffmpeg -i test.mp3 -acodec libopus -b:a 64000 -vbr on test.opus
(Debian squeeze, ffmpeg version 3.3.5)

According to wikipedia, the "opus" container should just be an ogg container (https://en.wikipedia.org/wiki/Opus_%28audio_format%29).
ffmpeg -i test.mp3 -acodec libopus -b:a 64000 -vbr on test.ogg
produces a different file from the previous one (md5 are mismatched).

Indeed, ffmpeg tells me so : "(...)Output #0, ogg, to 'test.ogg':(...)" instead of "(...)Output #0, opus, to 'za.opus':(...)"
file test.*
test.ogg: Ogg data, Opus audio,
test.opus: Ogg data, Opus audio,


What's going on here ?
What is the container used when encoding a file to ".opus" ?
Which one should I use (I'm aiming for maximum compatibility, mainly with android phones) ?

Thanks for reading !

N
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg.org with subject "uns
Kieran O Leary
2017-11-30 10:52:31 UTC
Permalink
Hi
Post by n***@free.fr
Hello all,
ffmpeg -i test.mp3 -acodec libopus -b:a 64000 -vbr on test.opus
(Debian squeeze, ffmpeg version 3.3.5)
According to wikipedia, the "opus" container should just be an ogg container (https://en.wikipedia.org/wiki/Opus_%28audio_format%29).
ffmpeg -i test.mp3 -acodec libopus -b:a 64000 -vbr on test.ogg
produces a different file from the previous one (md5 are mismatched).
I know nothing about these formats really, but using md5 for this kind
of comparison is sometimes flawed. With some formats, pieces of
metadata like 'encoded date', or perhaps a unique ID can be written.
So each time you run the same ffmpeg command, you will get a different
whole file MD5 value as a few small bits will indeed be different.

I mimicked your command and produced opus and ogg outputs from the
same input. Using mediainfo's trace feature, it looks to me like both
are pretty much identical, they just have different values for 'stream
serial number' and 'page checksum'. It looks to me as though both
files are pretty much identical otherwise. Here's the output of both
trace reports:
https://gist.github.com/kieranjol/45edc4871270ce6110d256590e71e229

I used
mediainfo --Details=1 test.ogg
mediainfo --Details=1 test.opus

to get those outputs.

Best,

Kieran.
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ff
n***@free.fr
2017-11-30 12:57:08 UTC
Permalink
Post by Kieran O Leary
I know nothing about these formats really, but using md5 for this kind
of comparison is sometimes flawed. With some formats, pieces of
metadata like 'encoded date', or perhaps a unique ID can be written.
So each time you run the same ffmpeg command, you will get a different
whole file MD5 value as a few small bits will indeed be different.
Oh, didn't thought thought of that. Makes sense.
Post by Kieran O Leary
I mimicked your command and produced opus and ogg outputs from the
same input. Using mediainfo's trace feature, it looks to me like both
are pretty much identical, they just have different values for 'stream
serial number' and 'page checksum'. It looks to me as though both
files are pretty much identical otherwise. Here's the output of both
https://gist.github.com/kieranjol/45edc4871270ce6110d256590e71e229
I used
mediainfo --Details=1 test.ogg
mediainfo --Details=1 test.opus
to get those outputs.
Well, I did first try with the graphical front-end of mediainfo, but the
version I used somehow didn't like the ".opus", and didn't show much
Comments. I guess command-line is always more reliable :)

Thanks !

N
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg
Carl Eugen Hoyos
2017-11-30 13:02:39 UTC
Permalink
With some formats, pieces of metadata like 'encoded date',
Iirc, we don't do that (not even for formats requesting it)
because it is considered a security issue.
(I may misremember though.)
or perhaps a unique ID can be written.
This is what ogg requires and is done.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg

Kieran O Leary
2017-11-30 11:50:16 UTC
Permalink
P.S
Post by n***@free.fr
What's going on here ?
Answered in previous email.
Post by n***@free.fr
What is the container used when encoding a file to ".opus" ?
OGG. opus just seems to be a codec, not a container. When you use the
.opus extension for your ffmpeg output, an OGG container is used, and
the filename extension is .opus.
Post by n***@free.fr
Which one should I use (I'm aiming for maximum compatibility, mainly with android phones) ?
I dunno, but according to the spec:
https://tools.ietf.org/html/rfc7845#section-9 - using the OGG
container with the .opus extension seems to be the way to go.
So this command line that you used is probably for the best :

ffmpeg -i test.mp3 -acodec libopus -b:a 64000 -vbr on test.opus

-K
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg.org wi
n***@free.fr
2017-11-30 12:59:34 UTC
Permalink
Post by Kieran O Leary
https://tools.ietf.org/html/rfc7845#section-9 - using the OGG
container with the .opus extension seems to be the way to go.
ffmpeg -i test.mp3 -acodec libopus -b:a 64000 -vbr on test.opus
For reference, from my own tests, using ".ogg" as a file ext is better,
as the mediascanner (the android process cataloging media files) doesn't
pick up ".opus" files.
However, YMMV, as I found at least one audio player that saw the
".opus", but not the ".ogg"...
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg.org with subject "unsub
Carl Eugen Hoyos
2017-11-30 12:14:04 UTC
Permalink
Post by n***@free.fr
ffmpeg -i test.mp3 -acodec libopus -b:a 64000 -vbr on test.opus
(Debian squeeze, ffmpeg version 3.3.5)
According to wikipedia, the "opus" container should just be an ogg
container (https://en.wikipedia.org/wiki/Opus_%28audio_format%29).
ffmpeg -i test.mp3 -acodec libopus -b:a 64000 -vbr on test.ogg
produces a different file from the previous one (md5 are mismatched).
Use -fflags +bitexact to get identical files, you will also get different
files when writing to out1.ogg and out2.ogg.

The file suffix ".opus" is just a shorthander for "-acodec opus -f ogg".

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ff
Carl Eugen Hoyos
2017-11-30 12:18:17 UTC
Permalink
Post by Carl Eugen Hoyos
Post by n***@free.fr
ffmpeg -i test.mp3 -acodec libopus -b:a 64000 -vbr on test.opus
ffmpeg -i test.mp3 -acodec libopus -b:a 64000 -vbr on test.ogg
produces a different file from the previous one (md5 are mismatched).
Use -fflags +bitexact to get identical files, you will also get different
files when writing to out1.ogg and out2.ogg.
To elaborate:
The ogg files contain a serial number if the option is not specified,
this serial number is created with a function producing pseudo-random
numbers.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg.org wi
n***@free.fr
2017-11-30 13:01:43 UTC
Permalink
Post by Carl Eugen Hoyos
The ogg files contain a serial number if the option is not specified,
this serial number is created with a function producing pseudo-random
numbers.
Ok, thanks for the more advanced explanation, I didn't knew about this
"feature", I never saw this serial number in the various tag editors I
used.

Thanks !
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg.org with subject "unsubscribe"
Loading...