Jump to content

Post processing - Remux file after recording with audio offset - Remux file not transcode on playback


docrob

Recommended Posts

docrob

Hi,

 

I have windows 7 i5 CPU (benchmark around 6700). It can transcode 2 streams but I will shortly be getting 4 tuner input so I'd imagine will have to record 3 or 4 streams in native TS format (hdhomerun UK freeview version).

The trouble is my samsung TV has a fixed 160ms audio delay if it directly plays ts files.

I can easily remux file to mkv very quickly at end of recording with an audio offset of -160 using avidemux command line or GUI and it plays perfectly on TV without need to trancode.

 

I have a batch file which will process all ts files in folder and subdirectories and moves original ts file to a separate directory so it doesn't get processed again and again:

 

set avidemux="C:\Program Files\Avidemux 2.6 - 64 bits\avidemux_cli.exe"
%avidemux%
for /R %%g in (*.ts) do %avidemux% --force-alt-h264 --load "%%g" --run 1_Avidemux-160MKV.py --save "%%g.mkv"
for /R %%G IN (*.ts) do move "%%G" "G:\Original EmbyTS Recordings"

 

My Avidemux-160MKV.py file contains this:

 

#PY  <- Needed to identify #
#--automatically built--
adm = Avidemux()
adm.videoCodec("copy")
adm.audioClearTracks()
adm.audioAddTrack(0)
adm.audioCodec(0, "copy");
adm.audioSetDrc(0, 0)
adm.audioSetShift(0, 1,-160)
adm.setContainer("MKV")

 

If i add avidemux_cli program to recording post processing application in emby, how can I get it to process the file as above (can avidemux be used in this way - what Post-processor command line arguments would I use?.

I don't mind if it doesn't save copy of original as I can just apply a +160 audio offset and remux back to ffTS to get back to basically the original.

I am happy to do it with ffmpeg but when I tried this a few days ago I got various audio errors although it did give some sort of output - happy to use anything if it works and I can automate it.

 

I would like to be able to record 2-3 streams in native ts format and play back 1 of the recordings at same time. My CPU (including desktop i7) struggles with this. All I need is for emby to remux video with audio offset rather than transcoding the playback stream. Is there any way of doing that?? Config setting for ffmpeg playback perhaps?

 

Thanks, Rob

 

 

 

Edited by docrob
Link to comment
Share on other sites

Hi, have you tried configuring the recording setting to preserve the original video?

Link to comment
Share on other sites

docrob

Thanks for super quick reply. I haven't as it said increases CPU demand and couldn't see what benefits it would give. I presume it just gives you 2 video files at end (a transcoded one and the original TS file?).

I could try but my samsung TV still has 160ms audio delay with native TS recordings and otherwise needs a transcoded version to avoid lipsync issue.

Link to comment
Share on other sites

docrob

Thanks you for replying/helping/educating me, I really appreciate it.

I have been testing with preserve video as well as preserve both audio and video but seems less stable when trying to playback an active recording which is what I really want to achieve. I'm sure it would be fine when recordings finish but that's not the issue for me.

Can I ask how do you force server to transcode as doesn't seem to always do this and as a result sometimes video not playing on client (android TV box, samsung TV app). ipad app always seems to force a transcode.

Thanks,

Rob

Link to comment
Share on other sites

docrob

Sorry for delay. Night time here. What I am trying to do is record a show and play back before it ends and be able to FFW through show whilst recording. I have managed to do it on android Tv client app but iPad app will play but not allow FFW at all. Ideally I'd like to be able to record 2 (maybe 3 or 4) streams and playback 1. That's where I don't think I can transcode on the fly whilst recording.

I have tried to record native Ts stream but when playing back on android it won't play now and doesn't seem to force emby server to transcode. iPad always causes server to transcode and plays back fine. Last night I noticed ffmpeg.exe running at 90% + despite no recording or playback occurring. Also at time when testing there were 3 or 4 ffmep.exe processes running 20-30% despite maybe only streaming to 1 device and not recording. Had to stop the processes manually many time. Server reboot. Reboot PC.

Have tried recording the normal HD and SSD but not much better.

The android tv app seems to fail quite a lot on playback which I think is because it doesn't seem to ask server to transcode. Can't see option to select transcode from android app. Presumably there is no option.

Thanks,

Rob

Link to comment
Share on other sites

@@docrob, we need to look at specific examples. it is very difficult to help otherwise. if you can please produce an example, and then attach the information requested in how to report a problem, we'll do our very best to help. thanks !

Link to comment
Share on other sites

docrob

Hi Luke.

Don't worry about this thread. A lot of the issues were with my Chinese import android box.

I have just posted here

https://emby.media/community/index.php?/topic/48382-recordings-failing-when-converting-to-mkv-when-recording-video-preserved/

About a request for a basic ffmpeg command line.

If you are able to help with that specific question I would be very grateful.

Thanks,

Rob

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