Changing packet side from 188 to 192 so sidecar can work

Is there some option for ffmpeg to produce the output with video packets of 192 bytes instead of 188 which sidecar does not like?

The .ts files were produced using OBS.

Input #0, mpegts, from '/media/My Video/Inspector Falke/2022-08-25 Falke S2-1.ts': Duration: 01:54:49.74, start: 0.040000, bitrate: 2848 kb/s Program 1 Metadata: service_name : Service01 service_provider: FFmpeg Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 100 tbc Stream #0:1[0x101]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 4 kb/s.

Rob.
 
Copy the streams from input to output making the output file .m2ts and then rename it back to .ts once it's done.
 
ffmpeg -i <input_filename_including_extension> <output_filename>.m2ts mv <output_filename>.m2ts <output_filename>.ts
 
I assumed you wanted to do this on the T2. But I guess you mean that OBS is running ffmpeg?
If there's somewhere to specify options, then this post might help.
 
Sorry, what do you mean by from input to output? With what?

ffmpeg -i <input_filename_including_extension> <output_filename>.m2ts mv <output_filename>.m2ts <output_filename>.ts
@Robert4583
If you are running ffmpeg directly, you won't need any parameters apart from the input and output, with the output extension being as specified by PRPR i.e. .m2ts

ffmpeg will recognise the output has an extension for a type that is 192 bytes by default, and adjust the copy without any other parameters.

Yes, it really is that simple.
Black Hole has kindly clarified by writing both the ffmpeg commend and the rename command for you.
 
I assumed you wanted to do this on the T2. But I guess you mean that OBS is running ffmpeg?
If there's somewhere to specify options, then this post might help.
I tried adding "-mpegts_m2ts_mode true -mpegts_flags system_b -mpegts_service_type digital_tv" to the ffmpeg options within OBS but it still produced 188 bytes which is a shame so I will just have to run ffmpeg -i manually after every recording followed by selecting OPT+/Sidecar and then OPT+/DetectAds.
 
What are you running OBS on?

What I normally do for a repetitive thing like this is set up a .bat (Windows) or Bash script (Linux/HDR-FOX) to automate the process. In the case of Windows, the .bat can be written so that individual files or batches of files are just drag&dropped onto the .bat (I imagine the same is true of a desktop Linux, but I'm not that "up" on it yet).
 
I don't think this approach is working for me. The output that is produced is of the 192 bytes but the quality of the video is heavily downgraded and there is no audio.

The video format has become BDAV Blu-ray Video and there are a number of other differences. I could list the mediainfo output if you want.

What are you running OBS on?
OBS is running on Windows. I also ran ffmpeg on windows because it was alot faster.

I am going to retry running ffmpeg with -c:v copy -c:a copy -mpegts_m2ts_mode true -mpegts_flags system_b -mpegts_service_type digital_tv and see if that helps.
 
ffmpeg reported "Stream 1, codec aac, is muxed as a private data stream and may not be recognized upon reading"

This time the quality looked OK but still no sound.
 
I don't think the video should be re-encoded when doing a stream conversion, and if it is it will take significantly longer to run.
 
I don't think this approach is working for me. The output that is produced is of the 192 bytes but the quality of the video is heavily downgraded and there is no audio.

The video format has become BDAV Blu-ray Video and there are a number of other differences. I could list the mediainfo output if you want.


OBS is running on Windows. I also ran ffmpeg on windows because it was alot faster.

I am going to retry running ffmpeg with -c:v copy -c:a copy -mpegts_m2ts_mode true -mpegts_flags system_b -mpegts_service_type digital_tv and see if that helps.
Converting a ts file to an m2ts file only needs the audio and video streams to be copied, as stated by @Black Hole and @prpr above. For example:
Code:
ffmpeg -i "File A.ts" -c copy "File A.m2ts"
This is all you need to copy one video and one audio stream from the ts file and change the packet size from 188 to 192 bytes. The additional parameters you included are not needed for this conversion. To play on the HDR-FOX T2 the output file needs to be renamed '.ts' from '.m2ts' even though it is actually in m2ts format. Try this and see if you still get no audio. The DVB-T2 broadcast audio stream is in aac with LATM syntax but the HDR-FOX T2 will also play aac (LC) without issue.
 
ffmpeg is not very good at doing this.

It can't handle subtitles. If you add -map 0 to include subtitles, it can't assign a PID for the subtitle stream, and I've never managed to successfully specify one for it.

It can't handle LATM audio streams - the 'private encoding' it uses is only understood by ffmpeg itself.

If anyone knows better I'd pleased to hear about it.
 
Converting a ts file to an m2ts file only needs the audio and video streams to be copied, as stated by @Black Hole and @prpr above. For example:
Code:
ffmpeg -i "File A.ts" -c copy "File A.m2ts"
This is all you need to copy one video and one audio stream from the ts file and change the packet size from 188 to 192 bytes. The additional parameters you included are not needed for this conversion. To play on the HDR-FOX T2 the output file needs to be renamed '.ts' from '.m2ts' even though it is actually in m2ts format. Try this and see if you still get no audio. The DVB-T2 broadcast audio stream is in aac with LATM syntax but the HDR-FOX T2 will also play aac (LC) without issue.
ffmpeg did run quickly enough but the sound is still not supported on the humax and also vlc on the pc does not play sound either.
 
The point of the additional options, in particular -mpegts_m2ts_mode true, is to modify the defaults implied by a destination .ts to match those implied by .m2ts, and therefore to avoid the need to rename the destination file after copying.

If the video quality was unsatisfactory compared with the input material, OBS is also doing some encoding and the settings for that would need to be changed.
 
With the file created using ffmpeg which the sound wasn't working and would play the video alright but after running sidecar the video would not play.

I am not winning here am I.
 
I don't understand why the method I indicated doesn't simply transfer the input streams to the output file (with the relevant alterations to the packet size).
 
Back
Top