Jump to content

best settings to re-encode a video with ffmpeg


Go to solution Solved by dust42,

Recommended Posts

Posted

i recently came across a video that refused to play, its normal, now and then, even though the video was marked as h264

however, i tried re-encoding the video multiple times and it still wouldn't play, played fine via vlc on the desktop

these were the ffmpeg settings i was using

ffmpeg -y -i x.mkv -c:v libx264 -preset ultrafast -qp 0 y.mp4

and

ffmpeg -y -i x.mkv -map 0:v:0 -map 0:a:0 -vcodec libx264 -acodec aac -map_metadata -1 y.mp4

both of the above did not work.

would appreciate if anyone can share the correct settings for ffmpeg to encode a video to play with emby android server

thanks

Posted

@Lukethanks for replying

i haven't tried the convert feature because my android device has only 4gb ram

i do have a pc that has 8gb ram and is running on linux so was hoping for a solution using

ffmpeg or handbrake or something similar

 

thanks

visproduction
Posted (edited)

Dust, when you run it, the app actually auto fixes a lot of the metadata issues.  It seems like it remuxes the video, if needed.  I use it with a batch file in Windows so the Emby media page shows the right original language.

For checking the video and setting the media language to English for any .mp4 in a directory or subdirectories, this und2en.bat  (undetermined to English) file does the trick.

for /R %%f in (*.mp4) do "C:\Program Files\GPAC\MP4Box.exe" -lang 2=en "%%f"
echo completed
pause

You can change the -lang 2=fr for French, de for German etc. and create separate batch files.

This batch could reassign hundreds of videos in a library directory and all subdirectories to be set as English with one click, if you wanted to do that.  Just put the batch file in the main directory and click.  It also checks for other issues and fixes them.  I run all mp4's through this and all my h.264 codec media plays back directly with no problem.

mp4box_set_language_batch_files.zip

Edited by visproduction
  • Like 1
  • Solution
Posted

for anyone who stumbles across this thread and is looking for a solution using a linux os with ffmpeg, you can try

ffmpeg -y -i x.mkv -c:v libx264 -profile:v baseline -c:a aac -ar 44100 -ac 2 -b:v 384k -movflags +faststart y.mp4

this worked for me

  • Like 1
visproduction
Posted (edited)

Response was suppose to be a different forum post - Sorry - removed.

Edited by visproduction

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...