Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
2nd July 2024, 16:23 | #1 | Link |
Registered User
Join Date: Oct 2003
Posts: 215
|
Change field-order flag in MPEG-2 program stream?
I have hundreds of MPEG-2 program stream files where, for reasons unknown, the field order flag in the program stream is wrong. This obviously leads to incorrect decoding on software players, showing the fields out of order which results in jittery playback.
Is there a utility or batch process I can use to simply set the field order flag in an MPEG-2 program stream to a specific field order? Linux or Windows is preferred. The goal is to avoid anything interactive, since I'm not going to do hundreds of these interactively. I'd like to do this without demuxing/remuxing because I'm worried about sync. I have FFMPEG installed, but wasn't able to figure out how to do it with FFMPEG without remuxing. |
5th August 2024, 00:05 | #2 | Link |
Registered User
Join Date: Oct 2003
Posts: 215
|
A kind random internet stranger helped me with this, so I thought I'd pay it forward by putting the final solution here for others to find. Their reply follows:
It's not possible in ffmpeg, because the mpeg-2 bitstream filter's limited. Trusty old Restream could do it, but AFAIK there's no batch option: https://www.videohelp.com/software/Restream There's a Linux version of DGPulldown that added the option to change the TFF flag. https://github.com/jaystevens/dgpull...pulldown_linux Clone the repo, and run the make file. From the README: To flag an interlaced m2v file as top field first use the command Code:
dgpulldown input.m2v -interlaced -o output.m2v Code:
dgpulldown input.m2v -interlaced -bff -o output.m2v Demux (to m2v and m2a) Code:
for file in *.mpg; do ffmpeg -i "$file" -map 0:v:0 -c:v copy "${file%.mpg}.m2v" -map 0:a:0 -c:a copy "${file%.mpg}.m2a" ; done Code:
# BFF for file in *.m2v; do dgpulldown "$file" -interlaced -bff -o "${file%.m2v}.mpv"; done # TFF for file in *.m2v; do dgpulldown "$file" -interlaced -o "${file%.m2v}.mpv"; done Option 1: ffmpeg Code:
for file in *.mpv; do ffmpeg -fflags +genpts -i "${file}" -i "${file//.mpv/.m2a}" -c copy "${file//.mpv/_remux.mpg}"; done Code:
for file in *.mpv; do mplex -f 8 -o "${file//.mpv/_remux.mpg}" "${file}" "${file//.mpv/.m2a}"; done whatever.mpg -> whatever.m2v (& whatever.m2a) -> whatever.mpv -> whatever_remux.mpg But please back up your files beforehand. :-) |
Thread Tools | Search this Thread |
Display Modes | |
|
|