Hi
I had a question regarding viewing uploaded media through the web platform.
The inhouse media upload API bypasses the transcoding by providing the sg_uploaded_movie_mp4 path to a Version entity when uploading. The problem is that this MP4 is not viewable in following scenarios:
- Windows Firefox
- Windows Chrome
- MacOS Safari
It is viewable in following scenarios:
- Linux (Manjaro) Firefox
- Windows Edge
Do I have to provide both WEBM and MP4 to fix this?
Is it a en/decoding missing from the system?
Are my assumptions completely wrong and is there something else I have to look at?
Cheers
Cedric
2 Likes
Hi @cduriau,
Thanks for posting!
By default, when uploading media onto Shotgun, it will be auto-transcoded into mp 4 and webm and filledin the sg_uploaded_movie_mp4
and sg_uploaded_movie_webm
. And then you could stream and playback with the recommended broswers on Windows/Linux/Mac OS.
See the Transcoding Service for more details.
But since you are bypassing the auto-transcoding, it’s up to how you codec/generate the mp4 media. Probably you should ensure the mp4 you upload follows the following variables as it’s what we are using in auto-transcoding service.
This is the FFmpeg code we run to generate the streamable movie files (one for H.264 and one for WebM). The variable substitution is ruby-style.
vcodec = "-vcodec libx264 -pix_fmt yuv420p -vf 'scale=trunc((a*oh)/2)*2:720' -g 30 -b:v 2000k -vprofile high -bf 0"
acodec = "-strict experimental -acodec aac -ab 160k -ac 2"
ffmpeg -i #{src_file} #{acodec} #{vcodec} -f mp4 #{dest_file_mp4}
vcodec = " -pix_fmt yuv420p -vcodec libvpx -vf 'scale=trunc((a*oh)/2)*2:720' -g 30 -b:v 2000k -vpre 720p -quality realtime -cpu-used 0 -qmin 10 -qmax 42"
acodec = "-acodec libvorbis -aq 60 -ac 2"
ffmpeg -i #{src_file} #{acodec} #{vcodec} -f webm #{dest_file_webm}
You could also refer to Do it yourself (DIY) transcoding to see the specifications we are using
1 Like
Hi Ben
I understand, and the settings you provide, coming from the DIY transcoding reference page if I’m not mistaken, are too low quality. Especially the resolution. We also apply a color matrix to ensure HQ rec709 media.
Here are the settings we use:
ffmpeg -y -start_number $frame -i $stream -c:v libx264 -vf colormatrix=bt601:bt709 -crf 16 -g 1 -r $fps $movie
I would totally understand if the media encoded with this command line would not work consistently throughout browsers. As mentioned before, this works fine on Linux Firefox, but not on Windows Firefox. Both of the browsers are on v77.x.x which are later than recommended versions.
How is this codec related if some OS browsers display the media and some not?
Cheers
Cedric
1 Like
If you take the same output mp4 file and just drag that into an empty Chrome browser window on Windows, does the file play in the browser? If not, then it would point to some missing codec on that system that’s preventing the browser (in both Shotgun player and non-Shotgun contexts). If it does play, however, then there may be something else in play with the overlay player and we’ll need to look at some example Versions directly.
2 Likes
Just to chip in, we use Windows 10 and Chrome and bypass auto-transcoding and only upload mp4 media.
Our MP4’s are HQ full HD videos sometimes with keyframes on every frame and we play back just fine.
None of our systems need a special codec pack or something.
Would really recommend you try and open the file directly in the browser to ensure it plays.
3 Likes
Hi @brandon.foster, @Ricardo_Musch
The uploaded media dragged into a browser for display purposes does not work where it does not play inside the shotgun frame either. This means we can conclude the operating system is missing a codec pack.
Playing it in viewing software such as RV does work, I presume because they ship with their own codec packs.
Cheers
Cedric
3 Likes
I would then double check what sort of h264 you are generating because Windows 10 includes those codecs by default.
2 Likes