Page 4 of 6
Re: mp4 like Adobe premiere result
Posted: Wed Sep 08, 2021 11:53 am
by Wahyu
Thanks for your information @FranceBB,
emcodem wrote: ↑Wed Sep 08, 2021 8:52 am
Also, please just try to export some 50p from adobe and test on playout. If it works, please upload the file, it will be VERY useful for us to also make your interlaced files work.
I've create 50p and playout is working
here's an experiment that :
ffmpeg export h264+mp2+ts directly -> playout fail
ffmpeg export libx264+mp2+ts directly -> playout fail
ffmpeg export h264_nvenc+mp2+ts directly -> playout fail
ffmpeg export h264_qsv+mp2+ts directly -> playout fail
x264 export x264+mp2+ts directly -> playout fail
avidemux export x264+mp2 -> ffmpeg mpegts(create ts) -> playout fail
premiere export h264+mp2 -> ffmpeg mpegts(create ts) -> playout works
Mainconcept export h264+mp2+ts directly -> playout works (this sample from them, i don't have MainConcept)
Re: mp4 like Adobe premiere result
Posted: Wed Sep 08, 2021 12:28 pm
by emcodem
Ok, that means that your playout accepts the h264 video from adobe but not the ts container from adobe,
in difference it does NOT accept any h264 from ffmpeg but it accepts the ts container from ffmpeg.
In the end this just means you always have to use ffmpeg to rewrap to ts before you send to playout, no matter who encodes the file
No need for mp4 in the chain at all. Well, it might be possible to tune the adobe .ts exporter to work on the playout as well but this is not the goal here
But this is what we already "knew".
As you successfully tested 50p from premiere now, we have it A LOT easier to check out whats disturbing in the ffmpeg x264 version.
First thing, can you please
upload a short and definitely working 50p example from premiere (wrapped to ts by ffmpeg)?
After that, we will
-) send you first a "default 50p x264 file" to check if this also does not work. (i assume that it will also not work)
-) after you confirmed that the 50p from libx264 is also not working, we will try to tune the h264 syntax generated by x264 to match exactly the adobe version.
-) If by any luck this leads to a successfully playing 50p from x264, i believe we have an easy time to generate an interlaced version, hopefully in all encoders, nvenc, qsv or x264
I am sorry that this takes so long but if you keep working with us like you do currently, i have a feeling that this will lead to success in the end.
Re: mp4 like Adobe premiere result
Posted: Wed Sep 08, 2021 5:03 pm
by Wahyu
Re: mp4 like Adobe premiere result
Posted: Thu Sep 09, 2021 12:43 pm
by emcodem
Just to let you know... we received your sample and it is just perfect, this is a good start. @FranceBB will try to generate a matching x264 version which we then - as described above - need to test (it should fail) before we go on.
Re: mp4 like Adobe premiere result
Posted: Fri Sep 10, 2021 11:49 am
by FranceBB
Ok, so, here's a new sample:
https://wetransfer.com/downloads/fd4532 ... 148/0bfa38
Here's the comparison (Mainconcept Left, x264 Right):
One more thing, of course, since color bars are digital and static, both MainConcept and x264 don't need so much bitrate to encode them, but the playout accepts CBR only so both encoders are trying to fill it with bogus values (zero-filling) which results in FF in the bitstream like so:
So we had to work a bit to get that done as FF as we were getting the encoder to zero-fill instead.
For instance, when we were trying with Intel QuickSync, we were getting zeroes so 00 instead of FF, which was adding yet another question mark to the whole thing...
Anyway, now we've got the fillers to be FF so we're good 'cause it's what we wanted and we also managed to preserve it while muxing.
So, we've got closer and closer, but we still have a few differences like:
has_b_frames=1 in Mainconcept Left, has_b_frames=2 in x264 Right
and
id=0x100 Mainconcept, Left, id=0x150 x264 right
This is the final BAT:
Code: Select all
x264.exe "\\mibctvan000\Ingest\MEDIA\temp\AVS Script.avs" --preset medium --profile Main --level 4.2 --ref 4 --bitrate 6000 --vbv-maxrate 6000 --vbv-bufsize 6000 --deblock -4:-4 --min-keyint 1 --keyint 50 --range tv --log-level info --thread-input --opencl --colormatrix bt709 --transfer bt709 --colorprim bt709 --videoformat component --nal-hrd cbr --output "\\mibctvan000\Ingest\MEDIA\temp\raw_video.h264"
ffmpeg.exe -i "\\mibctvan000\Ingest\MEDIA\temp\AVS Script.avs" -c:a pcm_s24le -ar 48000 -af loudnorm=I=-24:LRA=12:tp=-2 -f wav -y "\\mibctvan000\Ingest\MEDIA\temp\audio.wav"
ffmpeg.exe -i "\\mibctvan000\Ingest\MEDIA\temp\audio.wav" -filter_complex "channelsplit=channel_layout=4.0[CH1][CH2][CH3][CH4]" -map "[CH1]" -c:a pcm_s24le -ar 48000 "\\mibctvan000\Ingest\MEDIA\temp\ch1.wav" -map "[CH2]" -c:a pcm_s24le -ar 48000 "\\mibctvan000\Ingest\MEDIA\temp\ch2.wav" -map "[CH3]" -c:a pcm_s24le -ar 48000 "\\mibctvan000\Ingest\MEDIA\temp\ch3.wav" -map "[CH4]" -c:a pcm_s24le -ar 48000 "\\mibctvan000\Ingest\MEDIA\temp\ch4.wav"
ffmpeg.exe -i "\\mibctvan000\Ingest\MEDIA\temp\ch1.wav" -i "\\mibctvan000\Ingest\MEDIA\temp\ch2.wav" -filter_complex "[0:a][1:a]join=inputs=2:channel_layout=stereo[a]" -map "[a]" -c:a libtwolame -b:a 384k -ar 48000 -f mp2 "\\mibctvan000\Ingest\MEDIA\temp\ch12.mp2"
ffmpeg.exe -i "\\mibctvan000\Ingest\MEDIA\temp\ch3.wav" -i "\\mibctvan000\Ingest\MEDIA\temp\ch4.wav" -filter_complex "[0:a][1:a]join=inputs=2:channel_layout=stereo[a]" -map "[a]" -c:a libtwolame -b:a 384k -ar 48000 -f mp2 "\\mibctvan000\Ingest\MEDIA\temp\ch34.mp2"
ffmpeg.exe -use_wallclock_as_timestamps 1 -i "\\mibctvan000\Ingest\MEDIA\temp\raw_video.h264" -i "\\mibctvan000\Ingest\MEDIA\temp\ch12.mp2" -i "\\mibctvan000\Ingest\MEDIA\temp\ch34.mp2" -map 0:0 -map 1:0 -map 2:0 -c:v copy -c:a copy -f mpegts -muxrate 20000000 -metadata provider_name="Avisynth" -metadata service_provider="Avisynth" -metadata service_name="Avisynth" -mpegts_original_network_id 0x1122 -mpegts_transport_stream_id 0x3344 -mpegts_service_id 0x5566 -mpegts_pmt_start_pid 0x1500 -mpegts_start_pid 0x150 -mpegts_service_type "digital_tv" -mpegts_flags "resend_headers" -y "\\mibctvan000\Ingest\MEDIA\temp\output1.ts"
pause
Again I have low expectations, but please let us know if it works or if it fails and thank you for bearing with us and working with us and being as responsive and active as you've been, we appreciate it a lot.
Re: mp4 like Adobe premiere result
Posted: Fri Sep 10, 2021 6:55 pm
by Wahyu
I've tested and the results are still not working in playout. The sample you provide is 1 second long? the duration of the video does not match the results of the general title (mpeg-ts) on mediainfo.
Re: mp4 like Adobe premiere result
Posted: Fri Sep 10, 2021 10:31 pm
by FranceBB
Well I knew it wasn't going to work anyway...
Well I secretly hoped it was going to work, but anyway...
I guess I'm gonna pass the ball back to emcodem but even if I'm the one who posted it we've been working on this together...
By the way it should have been 500 frames of colour bars, so in a 50p stream that would be 10 seconds, in fact the dimension is around 24 MB which is pretty much like yours.
Re: mp4 like Adobe premiere result
Posted: Sat Sep 11, 2021 8:19 am
by emcodem
Ok great, thanks for testing this out @Wayhu
This test was more or less just prove that it is not (only) about PAFF vs MBAFF interlaced encoding here.
As said, we will now dive into some details of the h264 syntax and try to align the remaining differences. The expectation is that there is one single (little) difference in the h264 syntax that makes your playout rejecting all the ffmpeg versions.
But could you tell us how you did measure 1s duration for @FranceBB's file? All my decoders/players say it is about 10 seconds.
Re: mp4 like Adobe premiere result
Posted: Sat Sep 11, 2021 2:58 pm
by Wahyu
I saw showing duration in the playout. then I checked through mediainfo and I saw the difference between the duration of the TS and the duration of the video. what reads on playout is the duration of the video.
Re: mp4 like Adobe premiere result
Posted: Sun Sep 12, 2021 12:17 pm
by FranceBB
Uhm... I think I know what happened. I hope not, but I think I know... I'll come back on Monday with more tests and since we're at this I'll try to play with --bframes 3 --b-adapt 1 --no-weightb 1 in x264.