JPG->jpg ; MOV->mp4 ; jpgs and mp4s to 1024x576 ; concat => audio sync probs

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

JPG->jpg ; MOV->mp4 ; jpgs and mp4s to 1024x576 ; concat => audio sync probs

Philip Rhoades
People,

1. With something like:

PHR20002.JPG
PHR20003.JPG
PHR20004.JPG
PHR20005.JPG
PHR20006.JPG
PHR20007.JPG
PHR20008.JPG
PHR20009.JPG
PHR20010-1.JPG
PHR20010.JPG
PHR20011-1.JPG
PHR20011.JPG
PHR20012.JPG
PHR20013-1.JPG
PHR20013.JPG
PHR20014.JPG
PHR20015.JPG
PHR20016.JPG
PHR20017.JPG
PHR20018.JPG
PHR20019.JPG
PHR20020.JPG
PHR20021.JPG
PHR20022.JPG
PHR20023.MOV
PHR20024.JPG
PHR20025.JPG
PHR20026.JPG
PHR20027.MOV
PHR20028.MOV
PHR20029.MOV
PHR20030.MOV
PHR20031.JPG
PHR20032.JPG
PHR20033.JPG
PHR20034.JPG

2. Use ImageMagick to convert the JPGs to 1024x576 jpgs.

3. Use ffmpeg to convert the MOVs to 1024x576 mp4s.

4. Use ffmpeg to create mp4s from sequences of jpgs with a
concat_demuxer1.txt file something like:

duration 4
file PHR20003.jpg
duration 4
file PHR20004.jpg
duration 4
file PHR20005.jpg
duration 4
file PHR20006.jpg
duration 4
file PHR20007.jpg
duration 4
file PHR20008.jpg
duration 4
file PHR20009.jpg
duration 4
file PHR20010-1.jpg
duration 4
file PHR20011-1.jpg
duration 4
file PHR20012.jpg
duration 4
file PHR20013-1.jpg
duration 4
file PHR20014.jpg
duration 4
file PHR20015.jpg
duration 4
file PHR20016.jpg
duration 4
file PHR20017.jpg
duration 4
file PHR20018.jpg
duration 4
file PHR20019.jpg
duration 4
file PHR20020.jpg
duration 4
file PHR20021.jpg
duration 4
file PHR20022.jpg
duration 4

and a ffmpeg command like:

ffmpeg -f concat -i concat_demuxer1.txt -vf scale=1024:576 -r 30000/1001
output1.mp4

5. Since concatenating these created mp4s with the mp4s from the MOVs
caused audio sync problems, I had to also add an audio track to the
jpg-mp4s with something like this:

ffmpeg -ar 44100 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero \
   -i output${i}.mp4 \
   -vcodec copy \
   -acodec aac \
   -shortest output${i}_silent.mp4

6. Trying to concatenate the segments with an input.txt file like this:

file output1_silent.mp4
file PHR20023.mp4
file output2_silent.mp4
file PHR20027.mp4
file PHR20028.mp4
file PHR20029.mp4
file PHR20030.mp4
file output3_silent.mp4

with this command:

ffmpeg -f concat -i inputs.txt -vcodec copy -acodec copy \
2019-03-22_#1_XR_ClimateEmergencyDeclarationDayNSW_LoRes.mp4

still had audio sync problems - in the end I had to use Blender to
concatenate the video and audio segments manually.

Do people have any suggestions about how I might fix this concatenation
audio sync problem and be able to do everything I want with a ffmpeg
script?

Thanks!

PHil.
--
Philip Rhoades

PO Box 896
Cowra  NSW  2794
Australia
E-mail:  [hidden email]
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: JPG->jpg ; MOV->mp4 ; jpgs and mp4s to 1024x576 ; concat => audio sync probs

Nicolas George
Philip Rhoades (12019-06-06):
> 2. Use ImageMagick to convert the JPGs to 1024x576 jpgs.
>
> 3. Use ffmpeg to convert the MOVs to 1024x576 mp4s.

Since you are transcoding everything anyway, better do everything at
once with ffmpeg and the concat filter.

But anyway, let us try to find the cause of your problem.

> 5. Since concatenating these created mp4s with the mp4s from the MOVs caused
> audio sync problems, I had to also add an audio track to the jpg-mp4s with
> something like this:
>
> ffmpeg -ar 44100 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero \
>   -i output${i}.mp4 \
>   -vcodec copy \
>   -acodec aac \
>   -shortest output${i}_silent.mp4

Can you check the exact duration of the audio stream?

Anyway, using a lossy codec for intermediate storage is a recipe for bad
results. Use simple PCM.

Regards,

--
  Nicolas George

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

signature.asc (849 bytes) Download Attachment