DanN
28th November 2010, 16:23
I want to join avchd/mts files from a camcorder to a single mp4 file without re-encoding. There is an issue with audio/video sync coming from mts clips having different audio and video length. I managed to create a script with help from http://www.kucher.org/projects/avchd/
Now after upgrading my computer to Ubuntu 10.04 I have a problem with ffmpeg (that also was upgraded from SVN-r20918 (Dec 25 2009) to SVN-r25837 (Nov 28 2010)).
The script uses “eac3to.exe”, tsMuxeR and ffmpeg for joining and repackaging the clips in 3 steps:
1. eac3to.exe (wine) to join and demux ac3 and h264 streams
2. tsMuxeR to to mux the the ac3 and h264 streams. Output is a m2ts file with audio and video in sync.
3. ffmpeg to repackage the m2ts to a mp4 file
Now I get an error in the last step when running “ffmpeg -i temp.m2ts -f mp4 -vcodec copy -acodec copy test.mp4”:
[mp4 @ 0xa08daa0] st:0 error, non monotone timestamps 1 >= 1
av_interleaved_write_frame(): Operation not permitted
The “test.mp4” is only 48 bytes and not working.
The complete output from ffmpeg is:
FFmpeg version SVN-r25837, Copyright (c) 2000-2010 the FFmpeg developers
built on Nov 28 2010 13:59:29 with gcc 4.4.3
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab
libavutil 50.33. 0 / 50.33. 0
libavcore 0.14. 0 / 0.14. 0
libavcodec 52.97. 2 / 52.97. 2
libavformat 52.87. 1 / 52.87. 1
libavdevice 52. 2. 2 / 52. 2. 2
libavfilter 1.65. 0 / 1.65. 0
libswscale 0.12. 0 / 0.12. 0
libpostproc 51. 2. 0 / 51. 2. 0
Seems stream 0 codec frame rate differs from container frame rate: 50.00 (50/1) -> 50.00 (50/1)
Input #0, mpegts, from 'temp.m2ts':
Duration: 00:00:12.96, start: 599.960033, bitrate: 23723 kb/s
Program 1
Stream #0.0[0x1011]: Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, stereo, s16, 256 kb/s
Output #0, mp4, to 'test.mp4':
Metadata:
encoder : Lavf52.87.1
Stream #0.0: Video: libx264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], q=2-31, 25 tbn, 25 tbc
Stream #0.1: Audio: ac3, 48000 Hz, stereo, 256 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
[mp4 @ 0xa08daa0] st:0 error, non monotone timestamps 1 >= 1
av_interleaved_write_frame(): Operation not permitted
I am grateful for any advice.
And also: Is there a simpler batch processing on Linux, that join avchd/mts files to a single mp4 file without re-encoding?
Regards, Dan
Now after upgrading my computer to Ubuntu 10.04 I have a problem with ffmpeg (that also was upgraded from SVN-r20918 (Dec 25 2009) to SVN-r25837 (Nov 28 2010)).
The script uses “eac3to.exe”, tsMuxeR and ffmpeg for joining and repackaging the clips in 3 steps:
1. eac3to.exe (wine) to join and demux ac3 and h264 streams
2. tsMuxeR to to mux the the ac3 and h264 streams. Output is a m2ts file with audio and video in sync.
3. ffmpeg to repackage the m2ts to a mp4 file
Now I get an error in the last step when running “ffmpeg -i temp.m2ts -f mp4 -vcodec copy -acodec copy test.mp4”:
[mp4 @ 0xa08daa0] st:0 error, non monotone timestamps 1 >= 1
av_interleaved_write_frame(): Operation not permitted
The “test.mp4” is only 48 bytes and not working.
The complete output from ffmpeg is:
FFmpeg version SVN-r25837, Copyright (c) 2000-2010 the FFmpeg developers
built on Nov 28 2010 13:59:29 with gcc 4.4.3
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab
libavutil 50.33. 0 / 50.33. 0
libavcore 0.14. 0 / 0.14. 0
libavcodec 52.97. 2 / 52.97. 2
libavformat 52.87. 1 / 52.87. 1
libavdevice 52. 2. 2 / 52. 2. 2
libavfilter 1.65. 0 / 1.65. 0
libswscale 0.12. 0 / 0.12. 0
libpostproc 51. 2. 0 / 51. 2. 0
Seems stream 0 codec frame rate differs from container frame rate: 50.00 (50/1) -> 50.00 (50/1)
Input #0, mpegts, from 'temp.m2ts':
Duration: 00:00:12.96, start: 599.960033, bitrate: 23723 kb/s
Program 1
Stream #0.0[0x1011]: Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, stereo, s16, 256 kb/s
Output #0, mp4, to 'test.mp4':
Metadata:
encoder : Lavf52.87.1
Stream #0.0: Video: libx264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], q=2-31, 25 tbn, 25 tbc
Stream #0.1: Audio: ac3, 48000 Hz, stereo, 256 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
[mp4 @ 0xa08daa0] st:0 error, non monotone timestamps 1 >= 1
av_interleaved_write_frame(): Operation not permitted
I am grateful for any advice.
And also: Is there a simpler batch processing on Linux, that join avchd/mts files to a single mp4 file without re-encoding?
Regards, Dan