Jump to content

Program to convert multiple files - keep original resolution/bitrate?


casminkey
Go to solution Solved by arrbee99,

Recommended Posts

casminkey

Anyone know of a way to convert all of my video files into a standard format but retain the bitrate and resolution?  I love the built-in Emby conversion process but it's going to take forever and I don't want it consuming resources of my Emby server - I'd like to do it from another PC. The problem I'm running in to is I don't want them to end up with the same resolution and bitrate. If it's 1080p now, I'd like to keep it that way. If it's 4k now, I'd like to retain that. Same for a file that's either 60Mbps or 25Mbps, I don't want them all 60Mbps or 25Mbps. I just want to change the format (or container/codec, is that the right term?) so that's it plays better on a Roku, Firestick or Android TV.

Anyone have any hints or tips on how to go about doing this? Looking to match the Emby Convert process and over write the existing file:

image.png.e2cc522f9f3bb0a35a2792ea7a84ad4c.png

 

Thank you in advance!!

Link to comment
Share on other sites

RanmaCanada

Why?  What you want to do makes absolutely no sense.  It would be far easier to either replace your Roku devices, or upgrade your server so that you can properly transcode items on the fly.  All you would be doing is making your files worse.  The only files you could possibly be having issues with are anything that are in mp4 containers, which do not support streaming, and all you would need to do is pack them into an mkv container.

Please be more forthcoming with what file types you are having problems with and on what devices.  Converting your media is absolutely the last thing you should be doing, period.

Link to comment
Share on other sites

justinrh

If you just need to change the container of your files into MKV (as Ranma suggested), you could use a script to easily and quickly (low resources) convert them with FFmpeg, e.g.:

ffmpeg.exe -i mymovie.mp4 -codec copy mymovie.mkv

There are some GUI apps that could do this.

@RanmaCanadacan you expand on the MP4 streaming issue?

Link to comment
Share on other sites

RanmaCanada

MP4 is fine for "web streaming", but Emby doesn't employ "web streaming" unless you're using a brower (AFAIK).  It is also far inferior to mkv.  From what I understand most devices attempt to play the content as if it was local as they direct play the content, instead of "streaming".  You can see it in action when you attempt to watch a dolbyvision mp4 vs a dolbyvision mkv.  I have devices that support both and the DV mp4 files constantly have issues when viewed over Emby (work fine if watched local), vs the DV mkv files playing fine.  If your device doesn't support mkv playback, like crApple devices, then Emby does the work to repack it as a compatible container so it can be read as a "local file" and that is why they take time to load, unless you use third party software like Infuse.

If I am wrong, on the technical end, please feel free to correct me.  

My wording on "streaming" should have been more clear, for that I do apologize.  It gets complicated, quickly.

  • Thanks 1
Link to comment
Share on other sites

arrbee99
2 hours ago, justinrh said:

If you just need to change the container of your files into MKV (as Ranma suggested), you could use a script to easily and quickly (low resources) convert them with FFmpeg, e.g.:

ffmpeg.exe -i mymovie.mp4 -codec copy mymovie.mkv

There are some GUI apps that could do this.

@RanmaCanadacan you expand on the MP4 streaming issue?

When I try that it fails, surprisingly.

Link to comment
Share on other sites

arrbee99

of course, when I have this

ffmpeg -i TAR.mp4 -codec copy TAR.mkv

it fails

when I have this -

FFMpeg -i TAR.mp4 -c:v copy -c:a copy -c:s copy TAR.mkv

it fails

when I have this -

FFMpeg -i TAR.mp4 -c:v copy -c:a copy TAR.mkv

it works, copies subtitles as well, except it makes them huge

of course I'm only doing this to have subs that work

Link to comment
Share on other sites

RanmaCanada

@arrbee99if you're doing this to have subs that work, it's easier to just replace the devices.  Just replace your Roku devies with Firesticks.  You're taking the extremely painful way to solve your problem.  

Link to comment
Share on other sites

arrbee99

Well, not really. Its more my bad of habit of asking stuff in vaguely related topics.

I want to edit mp4's or mkv's but when I try I loose the subtitles. I did have a way round but that seems to bugger up the duration of the file. Now I think I can use a separate subtitle track and add it in to the edited file, but was hoping for an easier way.

Mostly though I try lots of different things and forget what I've already tried and its little variations...

Link to comment
Share on other sites

RanmaCanada

When you edit the video files, the subtitles will no longer match up with them and would need to fix them in programs like subtitle edit.  Most editing programs totally ignore subtitles.  If you want to mess with files you need to demux them and have only audio and video present, then address any changes you made to the timeline with the subs before muxing them back together.

  • Thanks 1
Link to comment
Share on other sites

On 9/16/2023 at 4:46 PM, arrbee99 said:

FFMpeg -i TAR.mp4 -c:v copy -c:a copy TAR.mkv

it works, copies subtitles as well, except it makes them huge

That doesn’t seem right, the output file should be a tinny bit smaller with that command?
Try the following to preserve all tracks while just switching the container.

ffmpeg -i <in>.<mp4|ts|avi|etc..> -c copy -map 0:v -map 0:a -map -0:s? <out>.mkv

 

Link to comment
Share on other sites

arrbee99

Nah, using that it gets rid of the sub track entirely.

btw, I meant huge as in visibly bigger (a lot bigger) text.

Link to comment
Share on other sites

casminkey
On 9/15/2023 at 4:13 PM, arrbee99 said:

Just wondering what you mean by 'so that's it plays better' ?

I believe you can use ffmpeg to convert files. don't know if articles like this help -

https://opensource.com/article/17/6/ffmpeg-convert-media-file-formats

 

Thank you! I've seen ffmpeg running all the time but didn't know what it was actually doing or know you could use it to convert video files. This was exactly what I was looking for and that article was extremely helpful.

When I say "plays better" I mean that 4k video's that need to be transcoded take a few extra seconds to start and seem to take extra time if you're jumping ahead or back. Sometimes they take a minute or two if you're resuming a movie halfway through. So if I can get them into a format that plays directly and not have my wife and kids complain when they have to wait 10 seconds, then everyone's happy. 🙂

  • Like 1
Link to comment
Share on other sites

casminkey
On 9/16/2023 at 2:02 PM, RanmaCanada said:

Why?  What you want to do makes absolutely no sense.  It would be far easier to either replace your Roku devices, or upgrade your server so that you can properly transcode items on the fly.  All you would be doing is making your files worse.  The only files you could possibly be having issues with are anything that are in mp4 containers, which do not support streaming, and all you would need to do is pack them into an mkv container.

Please be more forthcoming with what file types you are having problems with and on what devices.  Converting your media is absolutely the last thing you should be doing, period.

I actually did just upgrade my server:

  • Intel Xeon W-2125 Quad-core processor
  • Nvidia Quadro P4000
  • 32GB Memory
  • 256 SSD Drive

I think it's pretty good but not sure about the video card. Thoughts on that?

Link to comment
Share on other sites

RanmaCanada

There is no way to stop the buffering when a 4k video needs to be transcoded other than replacing said devices that are causing the transcoding to happen in the first place.  If your family are so impatient that they can't wait 10 freaking seconds, then either replace those devices with Android ones, or create accounts for them and BLOCK them from playing the 4k content.  Ideally, everyone should be using Android devices as they have the absolutely least problems out of every single device that Emby supports.  My i3-1115G4 laptop server has no wait time when direct playing any 4k content, while also transcoding multiple 1080p vidoes for people on crApple devices.

As for your setup, the P4000 is fine, as it will do the job at minimum.  Your bottleneck is usually the transfer of data between your file server and your rendering server.

Again, 4k content should be direct played, and anyone who can't wait for the transcoding to take place either needs to learn patience.  If they can't wait, then either replace their devices with ones that will direct play them, or stop them from playing the all together.   It's why I keep my 4k content separate, especially DV content.  It's easier to keep users who can't play this content out of those libraries than to listen to them constantly complaing about how "this movie sucks and looks like garbage" when the problem is either their stupid internet, or their choice of a horrible device that I absolutely refuse to help them with because I told them the experience would be bad.

Just because you can transcode 4k content, doesn't mean you should.

  • Agree 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...