Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

WebM "4K HDR" to MKV

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
1byte
Posts: 59
Joined: 2017-07-16 06:51

WebM "4K HDR" to MKV

#1 Post by 1byte »

As per post over here
http://forums.debian.net/viewtopic.php? ... 88#p656688

WebM (and AVI) is not support by DLNA ...

Looking into this, WebM is container based on a profile of Matroska.
Initially supported VP8 video and Vorbis audio streams and in 2013 it was updated to accommodate VP9 video and Opus audio.

My files are downloaded from YT:
3840x2160 2160p60 HDR 21696k , vp9.2, 60fps, video only,
audio only DASH audio 130k , opus @160k

So I have concatenated video and audio:
ffmpeg -i video.webm -i audio.webm.webm -c copy audio+video.webm

mediainfo audio+video.webm:

Format : WebM
Format version : Version 4 / Version 2
File size : 341 MiB
Duration : 2 min 34 s
Overall bit rate : 18.5 Mb/s
Writing application : Lavf57.56.101
Writing library : Lavf57.56.101

Video
ID : 1
Format : VP9
Codec ID : V_VP9
Duration : 2 min 34 s
Width : 3 840 pixels
Height : 2 160 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 59.940 FPS
Language : English
Default : Yes
Forced : No

Audio
ID : 2
Format : Opus
Codec ID : A_OPUS
Duration : 2 min 34 s
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 kHz
Compression mode : Lossy
Language : English
Default : Yes
Forced : No

And would like to without loosing quality convert/mux it to MKV

Looking at
https://developers.google.com/media/vp9/the-basics/
only has examples of re-encoding in WebM,
but searching the net has not return any results that
would indicate WebM to MKV would not loose quality ....

Is it possible to get WebM to MKV withou loosing quality?

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: WebM "4K HDR" to MKV

#2 Post by stevepusser »

You should be able to just use ffmpeg to convert it to the mkv container without any transcoding, just like you can do the same when converting from mp4 to mkv.

Code: Select all

ffmpeg -i Sample.webm -c copy Sample-webm-remuxed-with-ffmpeg.mkv
Avidemux should be able to do the same thing in a GUI/
MX Linux packager and developer

vbrummond
Posts: 4432
Joined: 2010-03-02 01:42

Re: WebM "4K HDR" to MKV

#3 Post by vbrummond »

Excellent answer. I recommend ffmpeg highly. I don't know if it is possible to do "copy" in handbrake, I'll take a look.
Always on Debian Testing

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: WebM "4K HDR" to MKV

#4 Post by debiman »

1byte wrote:My files are downloaded from YT:
3840x2160 2160p60 HDR 21696k , vp9.2, 60fps, video only,
audio only DASH audio 130k , opus @160k

So I have concatenated video and audio:
ffmpeg -i video.webm -i audio.webm.webm -c copy audio+video.webm
why do you need to do that?
HOW are you downloading them?
i know that youtube-dl is very configurable, maybe you could set it up to download in a format that minidlna can deal with?

PS: don't use 'YT', some folks don't understand it.

1byte
Posts: 59
Joined: 2017-07-16 06:51

Re: WebM "4K HDR" to MKV

#5 Post by 1byte »

debiman wrote:
1byte wrote:My files are downloaded from YT:
3840x2160 2160p60 HDR 21696k , vp9.2, 60fps, video only,
audio only DASH audio 130k , opus @160k

So I have concatenated video and audio:
ffmpeg -i video.webm -i audio.webm.webm -c copy audio+video.webm
why do you need to do that?
HOW are you downloading them?
i know that youtube-dl is very configurable, maybe you could set it up to download in a format that minidlna can deal with?

PS: don't use 'YT', some folks don't understand it.
Sorry YT = YouTube.

I used youtube-dl, downloading the files separately:
youtube-dl -F tO01J-M3g0U
youtube-dl -f 251 tO01J-M3g0U
youtube-dl -f 337 tO01J-M3g0U.

How do you downlod 4K HDR video from YoutTube using youtube-dl?

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: WebM "4K HDR" to MKV

#6 Post by debiman »

doesn't it always default to highest quality, for both video and audio?

1byte
Posts: 59
Joined: 2017-07-16 06:51

Re: WebM "4K HDR" to MKV

#7 Post by 1byte »

debiman wrote:doesn't it always default to highest quality, for both video and audio?
Nope:

139 m4a audio only DASH audio 48k , m4a_dash container, mp4a.40.5@ 48k (22050Hz), 899.06KiB
249 webm audio only DASH audio 50k , opus @ 50k, 912.10KiB
250 webm audio only DASH audio 65k , opus @ 70k, 1.15MiB
140 m4a audio only DASH audio 127k , m4a_dash container, mp4a.40.2@128k (44100Hz), 2.34MiB
251 webm audio only DASH audio 130k , opus @160k, 2.30MiB
171 webm audio only DASH audio 131k , vorbis@128k, 2.07MiB
160 mp4 256x144 DASH video 115k , avc1.4d400c, 30fps, video only, 2.05MiB
278 webm 256x144 144p 122k , webm container, vp9, 30fps, video only, 1.69MiB
133 mp4 426x240 DASH video 246k , avc1.4d4015, 30fps, video only, 4.52MiB
242 webm 426x240 240p 272k , vp9, 30fps, video only, 3.61MiB
243 webm 640x360 360p 513k , vp9, 30fps, video only, 6.92MiB
134 mp4 640x360 DASH video 636k , avc1.4d401e, 30fps, video only, 7.66MiB
244 webm 854x480 480p 988k , vp9, 30fps, video only, 12.66MiB
135 mp4 854x480 DASH video 1165k , avc1.4d401f, 30fps, video only, 15.27MiB
247 webm 1280x720 720p 2036k , vp9, 30fps, video only, 25.57MiB
136 mp4 1280x720 720p 2323k , avc1.4d401f, 30fps, video only, 29.77MiB
248 webm 1920x1080 1080p 3260k , vp9, 30fps, video only, 44.89MiB
302 webm 1280x720 720p60 3261k , vp9, 60fps, video only, 41.13MiB
298 mp4 1280x720 DASH video 3497k , avc1.4d4020, 60fps, video only, 50.22MiB
137 mp4 1920x1080 1080p 4375k , avc1.640028, 30fps, video only, 54.71MiB
303 webm 1920x1080 1080p60 5108k , vp9, 60fps, video only, 71.01MiB
299 mp4 1920x1080 DASH video 5868k , avc1.64002a, 60fps, video only, 88.13MiB
271 webm 2560x1440 1440p 10248k , vp9, 30fps, video only, 134.26MiB
264 mp4 2560x1440 DASH video 10455k , avc1.640032, 30fps, video only, 126.69MiB
308 webm 2560x1440 1440p60 15387k , vp9, 60fps, video only, 203.80MiB
313 webm 3840x2160 2160p 21981k , vp9, 30fps, video only, 314.00MiB
266 mp4 3840x2160 DASH video 23320k , avc1.640033, 30fps, video only, 282.78MiB
315 webm 3840x2160 2160p60 29805k , vp9, 60fps, video only, 457.80MiB
330 webm 256x144 144p60 HDR 156k , vp9.2, 60fps, video only, 2.38MiB
331 webm 426x240 240p60 HDR 256k , vp9.2, 60fps, video only, 3.87MiB
332 webm 640x360 360p60 HDR 485k , vp9.2, 60fps, video only, 7.35MiB
333 webm 854x480 480p60 HDR 909k , vp9.2, 60fps, video only, 13.83MiB
334 webm 1280x720 720p60 HDR 1991k , vp9.2, 60fps, video only, 28.18MiB
335 webm 1920x1080 1080p60 HDR 3201k , vp9.2, 60fps, video only, 49.70MiB
336 webm 2560x1440 1440p60 HDR 11166k , vp9.2, 60fps, video only, 170.21MiB
337 webm 3840x2160 2160p60 HDR 21696k , vp9.2, 60fps, video only, 339.06MiB
17 3gp 176x144 small , mp4v.20.3, mp4a.40.2@ 24k
36 3gp 320x180 small , mp4v.20.3, mp4a.40.2
43 webm 640x360 medium , vp8.0, vorbis@128k
18 mp4 640x360 medium , avc1.42001E, mp4a.40.2@ 96k
22 mp4 1280x720 hd720 , avc1.64001F, mp4a.40.2@192k (best)

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: WebM "4K HDR" to MKV

#8 Post by stevepusser »

Well, Clipgrab lets me download 4K videos in .mp4 format, which I am certain is supported by DLNA. Or you can also set it convert any videos not available in mp4 to that format. It uses ffmpeg for that, so you also need that installed. I haven't tested to see if it's smart enough to just copy the streams over without transcoding.

But since the webm container is just based on a profile of mkv, have you tried just renaming the file to mkv to see if DLNA accepts it?
MX Linux packager and developer

Post Reply