Tdi-Me
Posts: 38
Joined: Fri May 05, 2017 8:11 pm

ffmpeg audio encoding / tricking?

Sun Oct 08, 2017 4:02 pm

I really like using emby server on my pi. I only have one problem with it. When it comes to transcoding they use the default audio encoder built into ffmpeg. I am sure this is high quality audio and all that but its a major drag for the pi. I have been poking around looking for information on ffmpeg to try setting another audio encoder as the default but i havent found anything. So i am curious, is there a way to take in the ffmpeg command with all the variables passed to to and then add a variable into it for execution? for example emby sends the command:

Code: Select all

 ffmpeg -fflags +igndts -i "http://127.0.0.1:8096/LiveTv/LiveStreamFiles/2b4f55d4dbf34735bbda8ae67fb0ca2b/stream.ts" -map_metadata -1 -map_chapters -1 -threads 3 -sn -codec:v:0 h264_omx  -b:v 5000000 -maxrate 5000000 -bufsize 10000000 -force_key_frames "expr:gte(t,n_forced*3)" -vf "yadif=0:-1:0,scale=trunc(min(max(iw\,ih*dar)\,1920)/2)*2:trunc(ow/dar/2)*2" -flags -global_header -vsync cfr -codec:a:0 aac -strict experimental -ac 6 -ab 192000  -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3  -individual_header_trailer 0 -segment_format mpegts -segment_list_entry_prefix "hls/0195277a6162d3dc6214e6aaf8beca5f/" -segment_list_type m3u8 -segment_start_number 0 -segment_list "/emby/emby-paths/transcode-temp/transcoding-temp/0195277a6162d3dc6214e6aaf8beca5f.m3u8" -y "/emby/emby-paths/transcode-temp/transcoding-temp/0195277a6162d3dc6214e6aaf8beca5f%d.ts"
I would like to send

Code: Select all

 ffmpeg -fflags +igndts -i "http://127.0.0.1:8096/LiveTv/LiveStreamFiles/2b4f55d4dbf34735bbda8ae67fb0ca2b/stream.ts" -map_metadata -1 -map_chapters -1 -threads 3 -sn -codec:v:0 h264_omx  -b:v 5000000 -maxrate 5000000 -bufsize 10000000 -force_key_frames "expr:gte(t,n_forced*3)" -vf "yadif=0:-1:0,scale=trunc(min(max(iw\,ih*dar)\,1920)/2)*2:trunc(ow/dar/2)*2" -flags -global_header -vsync cfr -codec:a:0 aac -strict experimental -ac 6 -ab 192000  -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3  -individual_header_trailer 0 -segment_format mpegts -segment_list_entry_prefix "hls/0195277a6162d3dc6214e6aaf8beca5f/" -segment_list_type m3u8 -segment_start_number 0 -segment_list -c:a libmp3lame "/emby/emby-paths/transcode-temp/transcoding-temp/0195277a6162d3dc6214e6aaf8beca5f.m3u8" -y "/emby/emby-paths/transcode-temp/transcoding-temp/0195277a6162d3dc6214e6aaf8beca5f%d.ts" 
So that ffmpeg will use libmp3lame as the audio encoder. Is there a way to do this? Or is anyone familiar enough with emby to tell me what to edit to change the ffmpeg command that emby uses? Thank you.

Tdi-Me
Posts: 38
Joined: Fri May 05, 2017 8:11 pm

Re: ffmpeg audio encoding / tricking?

Sun Oct 08, 2017 4:38 pm

I have been fooling around with trying to use variables for this but its been maddening to try capturing all the variables correctly. Is there a way to capture everything sent up to a certain point and then insert something?
I can just imagine to people more familiar with linux this is probably an easy task.

Return to “Graphics programming”